Property Sinks

The properties-transfer Mojo allows to copy property definitions from a project (or some arbitrary source) to a destination (e.g. another folder or a database).

Please refer to Usage Transfer for more information about that Mojo.

This page shows property sink implementations that are currently available.

List of Resource and Transfer Implementations

Here we provide an overview over implementations to be used for transfer and sink tasks.

Resource

A resource implementation discovers property definitions. These implementations are used by the plugin for discovery:

Transfer

To transfer property definitions to a sink, use one of the following transfer implementations:

We give a some examples of usage in the next sections. Please refer to the project's home page for further information.

File System

This sink allows to write properties to a file system.

Installation

Add the following dependency to the dependencies block of the plugin declaration.

<dependencies>
  <dependency>
    <groupId>de.smartics.properties</groupId>
    <artifactId>smartics-properties-transfer-filesystem</artifactId>
    <version>//add-version-here//</version>
  </dependency>

Configuration

The factory implementation is:

de.smartics.properties.config.transfer.filesystem.Factory

The following properties are supported:

Property Description
targetFolder The folder to write the properties to.
outputFormat The output format of the files written to the sink. Allowed values are:
  • native - standard properties file format
  • xml (standard XML properties file format)

Example

Here is an example of a configuration:

<propertySinkFactory implementation="de.smartics.properties.config.transfer.filesystem.Factory">
  <targetFolder>\${basedir}/target/testme</targetFolder>
  <outputFormat>xml</outputFormat>
</propertySinkFactory>

JDBC

This sink allows to write properties to a database accessed by a JDBC driver.

Installation

Add the following dependency to the dependencies block of the plugin declaration.

<dependencies>
  <dependency>
    <groupId>de.smartics.properties</groupId>
    <artifactId>smartics-properties-transfer-jdbc</artifactId>
    <version>//add-version-here//</version>
  </dependency>

Also add a dependency to a vendor specific data source proxy implementation. In the example it is a proxy for MySql:

<dependency>
  <groupId>de.smartics.properties</groupId>
  <artifactId>smartics-properties-config-mysql</artifactId>
  <version>//add-version-here//</version>
</dependency>

Configuration

The factory implementation is:

de.smartics.properties.config.transfer.jdbc.Factory

The following properties are supported:

Property Description
databaseId The database identifier to select the datasource proxy for a database product.
jdbcUrl The JDBC URL to the database.
user The user to authenticate against the database.
password The password to authenticate against the database.
dropTable The flag that signals to drop properties table (true) or not (false).
createTable The flag that signals to create properties table (true) or not (false).

Example

Here is an example of a configuration:

<propertySinkFactory implementation="de.smartics.properties.config.transfer.jdbc.Factory">
  <databaseId>mysql</databaseId>
  <jdbcUrl>jdbc:mysql://localhost:3306/properties</jdbcUrl>
  <user>properties</user>
  <password>properties</password>
</propertySinkFactory>