Usage

The Merge Properties Maven Plugin merges properties files specified by Resource elements to the an output file located in an output directory. There is currently only one goal merge that by default is bound to the process-resources phase.

This plugin is based on the maven-resources-plugin and has a very similar configuration.

To handle filtering this version of Merge Properties Maven Plugin uses Maven Filtering ${mavenFilteringVersion}.

Example

The following example merges all properties files into one single output file:

<plugin>
  <groupId>org.polago.maven.plugins</groupId>
  <artifactId>merge-properties-maven-plugin</artifactId>
  <version>1.2</version>
  <configuration>
    <outputDirectory${project.build.directory}/generated-resources</outputDirectory>
    <outputFile>out.properties</outputFile>
    <resources>
      <resource>
        <directory>src/main/properties</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>merge</goal>
      </goals>
    </execution>
  </executions>
</plugin>

The following example merges resource bundles properties files into one file per Locale:

<plugin>
  <groupId>org.polago.maven.plugins</groupId>
  <artifactId>merge-properties-maven-plugin</artifactId>
  <version>1.2</version>
  <configuration>
    <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
  </configuration>
  <executions>
    <execution>
      <id>merge-en</id>
      <goals>
        <goal>merge</goal>
      </goals>
      <configuration>
        <outputFile>Resources_en.properties</outputFile>
        <resources>
          <resource>
            <directory>src/main/properties</directory>
            <filtering>true</filtering>
            <includes>
              <include>**/*_en.properties</include>
            </includes>
          </resource>
        </resources>
      </configuration>
    </execution>
    <execution>
      <id>merge-sv</id>
      <goals>
        <goal>merge</goal>
      </goals>
      <configuration>
        <outputFile>Resources_sv.properties</outputFile>
        <resources>
          <resource>
            <directory>src/main/properties</directory>
            <filtering>true</filtering>
            <includes>
              <include>**/*_sv.properties</include>
            </includes>
          </resource>
        </resources>
      </configuration>
    </execution>
  </executions>
</plugin>