<?xml version="1.0" encoding="UTF-8"?>

<!--
 - Copyright 2014-2015 Polago AB.
 -
 - Licensed under the Apache License, Version 2.0 (the "License");
 - you may not use this file except in compliance with the License.
 - You may obtain a copy of the License at
 -
 -      http://www.apache.org/licenses/LICENSE-2.0
 -
 - Unless required by applicable law or agreed to in writing, software
 - distributed under the License is distributed on an "AS IS" BASIS,
 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 - See the License for the specific language governing permissions and
 - limitations under the License.
 -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.polago.maven.plugins</groupId>
  <artifactId>merge-properties-maven-plugin</artifactId>
  <version>1.0</version>
  <packaging>maven-plugin</packaging>
  <name>Merge Properties Maven Plugin</name>
  <url>http://www.polago.org/merge-properties-maven-plugin/</url>

  <description>
    Merge Properties Maven Plugin is a Maven Plugin that merges and filters a 
    set of Java Properties files into a single file while detecting multiple 
    instances of the same Property Key.
  </description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <mavenFilteringVersion>1.1</mavenFilteringVersion>
    <mavenVersion>3.0.4</mavenVersion>
    <mavenPluginPluginVersion>3.4</mavenPluginPluginVersion>
    <jdkVersion>1.7</jdkVersion>
    <surefireVersion>2.18.1</surefireVersion>
    <docGroupId>${project.groupId}</docGroupId>
    <docArtifactId>${project.artifactId}</docArtifactId>
    <docVersion>${project.version}</docVersion>
  </properties>

  <prerequisites>
    <maven>${mavenVersion}</maven>
  </prerequisites>

  <inceptionYear>2014</inceptionYear>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>

  <organization>
    <name>Polago AB</name>
    <url>http://www.polago.com/</url>
  </organization>

  <developers>
    <developer>
      <name>Per Landberg</name>
      <id>perlan</id>
      <email>per.landberg@polago.org</email>
      <url>https://github.com/perlan</url>
      <organization>Polago AB</organization>
      <organizationUrl>http://www.polago.com/</organizationUrl>
      <roles>
        <role>Project Lead</role>
      </roles>
      <timezone>Europe/Stockholm</timezone>
    </developer>
  </developers>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/polagoab/merge-properties-maven-plugin/issues</url>
  </issueManagement>

  <ciManagement>
    <system>Travis</system>
    <url>https://travis-ci.org/polagoab/merge-properties-maven-plugin</url>
  </ciManagement>

  <scm>
    <connection>scm:git:https://github.com/polagoab/merge-properties-maven-plugin.git</connection>
    <developerConnection>scm:git:https://github.com/polagoab/merge-properties-maven-plugin.git</developerConnection>
    <url>https://github.com/polagoab/merge-properties-maven-plugin</url>
  </scm>

  <distributionManagement>
    <site>
      <id>website</id>
      <url>scp://www.polago.org/var/www/html/${project.artifactId}/</url>
    </site>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${mavenVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>${mavenPluginPluginVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>3.0.22</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-annotations</artifactId>
        <version>1.6</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.shared</groupId>
        <artifactId>maven-filtering</artifactId>
        <version>${mavenFilteringVersion}</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.plugin-testing</groupId>
        <artifactId>maven-plugin-testing-harness</artifactId>
        <version>3.3.0</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-component-annotations</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-filtering</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <!-- fix m2e warning of ignored plugin -->
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <versionRange>[0.6.2.201302030002,)</versionRange>
                    <goals>
                      <goal>prepare-agent</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>

                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-component-metadata</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>generate-metadata</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>

                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <versionRange>[1.5.5,)</versionRange>
                    <goals>
                      <goal>descriptor</goal>
                      <goal>helpmojo</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.6</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.15</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.6.1</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <source>${jdkVersion}</source>
            <target>${jdkVersion}</target>
            <!-- workaround for https://jira.codehaus.org/browse/MCOMPILER-209 -->
            <useIncrementalCompilation>false</useIncrementalCompilation>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4</version>
          <executions>
            <execution>
              <id>enforce-versions</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>${mavenVersion}</version>
                  </requireMavenVersion>
                  <requireJavaVersion>
                    <version>${jdkVersion}</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${surefireVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-help-plugin</artifactId>
          <version>2.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.3</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jxr-plugin</artifactId>
          <version>2.5</version>
          <configuration>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>3.4</version>
          <configuration>
            <targetJdk>${jdkVersion}</targetJdk>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.8</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${mavenPluginPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.4</version>
          <dependencies>
            <!-- add support for ssh/scp -->
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-ssh</artifactId>
              <version>2.8</version>
            </dependency>              
            <!-- reflow-maven-skin -->
            <dependency>
              <groupId>lt.velykis.maven.skins</groupId>
              <artifactId>reflow-velocity-tools</artifactId>
              <version>1.1.1</version>
            </dependency>
            <dependency>
              <groupId>org.apache.velocity</groupId>
              <artifactId>velocity</artifactId>
              <version>1.7</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-report-plugin</artifactId>
          <version>${surefireVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefireVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.7.4.201502262128</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>jdepend-maven-plugin</artifactId>
          <version>2.0</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>taglist-maven-plugin</artifactId>
          <version>2.4</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.1</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-metadata</artifactId>
          <version>1.6</version>
        </plugin>

        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.5</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <goalPrefix>merge-properties</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>amend-unit-test-java-agent-option</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-descriptor</id>
            <goals>
              <goal>attach-descriptor</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <locales>en</locales>
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
              <reportSets>
                <reportSet>
                  <reports>
                    <report>cim</report>
                    <report>dependencies</report>
                    <report>dependency-convergence</report>
                    <report>dependency-info</report>
                    <report>dependency-management</report>
                    <report>distribution-management</report>
                    <report>issue-tracking</report>
                    <report>license</report>
                    <report>mailing-list</report>
                    <report>modules</report>
                    <report>plugin-management</report>
                    <report>plugins</report>
                    <report>project-team</report>
                    <report>scm</report>
                    <report>summary</report>
                  </reports>
                </reportSet>
              </reportSets>
              <configuration>
                <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jxr-plugin</artifactId>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-report-plugin</artifactId>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-checkstyle-plugin</artifactId>
              <configuration>
                <configLocation>${basedir}/etc/checkstyle.xml</configLocation>
                <propertyExpansion>basedir=${basedir}</propertyExpansion>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-pmd-plugin</artifactId>
            </plugin>

            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <configuration>
                <minmemory>128m</minmemory>
                <maxmemory>512m</maxmemory>
                <quiet>true</quiet>
              </configuration>
              <reportSets>
                <reportSet>
                  <reports>
                    <report>javadoc</report>
                        <!-- <report>test-javadoc</report> -->
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>

            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>jdepend-maven-plugin</artifactId>
              <configuration>
                <classDirectory>target/build/classes</classDirectory>
              </configuration>
            </plugin>

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-plugin-plugin</artifactId>
              <reportSets>
                <reportSet>
                  <reports>
                    <report>report</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>

            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>taglist-maven-plugin</artifactId>
              <configuration>
                <tagListOptions>
                  <tagClasses>
                    <tagClass>
                      <displayName>Todo</displayName>
                      <tags>
                        <tag>
                          <matchString>TODO</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                        <tag>
                          <matchString>FIXME</matchString>
                          <matchType>ignoreCase</matchType>
                        </tag>
                        <tag>
                          <matchString>@todo</matchString>
                          <matchType>exact</matchType>
                        </tag>
                      </tags>
                    </tagClass>
                    <tagClass>
                      <displayName>Deprecated</displayName>
                      <tags>
                        <tag>
                          <matchString>@deprecated</matchString>
                          <matchType>exact</matchType>
                        </tag>
                      </tags>
                    </tagClass>
                  </tagClasses>
                </tagListOptions>
                <tag></tag>
              </configuration>
            </plugin>
          </reportPlugins>
        </configuration>

      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>ossrh</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>
    <profile>
      <id>run</id>
      <build>
        <plugins>
          <plugin>
            <groupId>${project.groupId}</groupId>
            <artifactId>${project.artifactId}</artifactId>
            <version>${project.version}</version>
            <configuration>
              <outputDirectory>${basedir}/target/merged</outputDirectory>
              <outputFile>out.properties</outputFile>
              <overwriteProperties>false</overwriteProperties>
              <resources>
                <resource>
                  <directory>src/test/resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>merge</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>it</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.10</version>
            <configuration>
              <projectsDirectory>src/it</projectsDirectory>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <debug>true</debug>
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <goals>
                <goal>clean</goal>
                <goal>process-resources</goal>
              </goals>
              <settingsFile>src/it/settings.xml</settingsFile>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
