Skip to content
ofersk edited this page Oct 5, 2020 · 1 revision

CxConfigProvider


What is it?
Quick Start
Configuration

CxConfigProvider is a Java library that helps in handling configurations.
It can read configurations in JSON or YAML formats, and initialises a bean with the configuration.

  1. add cx-config-provider to your build path ( maven , gradle , or jar)
  2. create a bean that matches the configuration
  3. in your code get an instance of config provider
ConfigProvider configProvider = ConfigProvider.getInstance();
  1. initialize it with a ConfigReader
configProvider.init(uid, configReader)
  1. load the configuration into a bean
MyConfig myConfiguration = configProvider.getConfiguration(uid, myProperties.CONFIG_PREFIX, MyConfig.class);

to see what ConfigProvider can do, look at the scenarios

You can find published releases on Maven Central.

add the dependency to your pom.xml

<dependency>
    <groupId>com.checkmarx</groupId>
    <artifactId>cx-config-provider</artifactId>
    <version>1.0.7</version>
</dependency>

run

mvn clean install

add dependency to build.gradle

dependencies {
    compile("com.checkmarx:cx-config-provider:1.0.7")
}

run

gradlew clean build
Clone this wiki locally