Integration with Maven

Library Dependency

To use this library in your Maven project add the following dependency to your POM:

<dependency>
  <groupId>de.smartics.properties</groupId>
  <artifactId>smartics-properties-config</artifactId>
  <version>0.3.0</version>
</dependency>

Generation of Metadata

To generate the optional but recommended properties metadata for the META-INF/smartics-properties folder of the Java archive artifact, add the smartics-properties-maven-plugin to your POM.

<plugin>
  <groupId>de.smartics.properties</groupId>
  <artifactId>smartics-properties-maven-plugin</artifactId>
  <executions>
    <execution>
      <id>properties-xml-export</id>
      <goals>
        <goal>xml-export</goal>
      </goals>
    </execution>
  </executions>
</plugin>

The information may also be edited manually or not at all. If you omit the information, the runtime system will have less information to the user of the system about properties (i.e. the Javadoc comments) and additional information (e.g. home page URL of the project) about them on the web.

For more information please refer to XML Report.

Module Dependencies

If properties are declared in separate modules. The modules are added as dependencies as usual. E.g.:

<dependency>
  <groupId>com.example.mycorporation</groupId>
  <artifactId>module-mail</artifactId>
</dependency>
<dependency>
  <groupId>com.example.mycorporation</groupId>
  <artifactId>module-epayment</artifactId>
</dependency>

Property Definitions

It is easy to separate the property set definitions from the rest of the code and add the static properties to the class path (in this case all properties are required to be read-only). E.g.:

<dependency>
  <groupId>com.example.mycorporation</groupId>
  <artifactId>my-application-config-production</artifactId>
</dependency>

Note: If you want also have write-access to your properties you have to choose a configuration implementation that may manage the properties in a persistent backend store.