Introduction

Implementation to transfer properties to a database via JDBC.

The following examples show how to configure the smartics-properties-maven-plugin with this transfer implementation.

MySQL

The following configuration generates an SQL script to run on a MySQL database:

<plugin>
  <groupId>de.smartics.properties</groupId>
  <artifactId>smartics-properties-maven-plugin</artifactId>
  <version>/add current version here/</version>
  <executions>
    <execution>
      <id>properties-transfer</id>
      <phase>package</phase>
      <goals>
        <goal>properties-transfer</goal>
      </goals>
      <configuration>
        <propertySinkFactory implementation="de.smartics.properties.config.transfer.jdbc.Factory">
          <databaseId>mysql</databaseId>
          <jdbcUrl>jdbc:mysql://localhost:3306/properties</jdbcUrl>
          <user>enter_user_here</user>
          <password>enter_password_here</password>
        </propertySinkFactory>
      </configuration>
    </execution>
  </executions>

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

  <configuration>
    <artifactItems>
      ... OPTIONAL: add any artifacts with property definitions here ...
    </artifactItems>
    <definitionConfigParser
      implementation="de.smartics.properties.impl.config.domain.key.rtaware.TenantUserDefinitionConfigParser" />
  </configuration>
</plugin>

Please refer to the home page of smartics-properties-config-mysql for more information on the proxy implementation.

HSQL

The following configuration generates an SQL script to run on a HSQL database:

<plugin>
  <groupId>de.smartics.properties</groupId>
  <artifactId>smartics-properties-maven-plugin</artifactId>
  <version>/add current version here/</version>
  <executions>
    <execution>
      <id>properties-transfer</id>
      <phase>package</phase>
      <goals>
        <goal>properties-transfer</goal>
      </goals>
      <configuration>
        <propertySinkFactory implementation="de.smartics.properties.config.transfer.jdbc.Factory">
          <databaseId>hsql</databaseId>
          <jdbcUrl>enter_hsql_jdbc_url_here</jdbcUrl>
          <user>enter_user_here</user>
          <password>enter_password_here</password>
        </propertySinkFactory>
      </configuration>
    </execution>
  </executions>

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

  <configuration>
    <artifactItems>
      ... OPTIONAL: add any artifacts with property definitions here ...
    </artifactItems>
    <definitionConfigParser
      implementation="de.smartics.properties.impl.config.domain.key.rtaware.TenantUserDefinitionConfigParser" />
  </configuration>
</plugin>

Please refer to the home page of smartics-properties-config-hsql for more information on the proxy implementation.