-
Notifications
You must be signed in to change notification settings - Fork 2
Home
ofersk edited this page Oct 5, 2020
·
1 revision
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.
- add cx-config-provider to your build path ( maven , gradle , or jar)
- create a bean that matches the configuration
- in your code get an instance of config provider
ConfigProvider configProvider = ConfigProvider.getInstance();
- initialize it with a
ConfigReader
configProvider.init(uid, configReader)
- 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