<!--
~ Copyright 2012-2013 Thomas Bouffard (redfish4ktc)
~
~ 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.github.redfish4ktc.parent</groupId>
  <artifactId>redfish4ktc-maven-oss-parent</artifactId>
  <version>7</version>
  <packaging>pom</packaging>
  <name>redfish4ktc-maven-oss-parent</name>
  <description>Maven parent for open source projects</description>
  <inceptionYear>2012</inceptionYear>

  <url>https://github.com/redfish4ktc/redfish4ktc-maven-parent</url>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:redfish4ktc/redfish4ktc-maven-parent.git</connection>
    <developerConnection>scm:git:git@github.com:redfish4ktc/redfish4ktc-maven-parent.git</developerConnection>
    <url>git@github.com:redfish4ktc/redfish4ktc-maven-parent.git</url>
    <tag>redfish4ktc-maven-oss-parent-7</tag>
  </scm>
  <developers>
    <developer>
      <name>Thomas Bouffard</name>
      <id>redfish4ktc</id>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>+1</timezone>
    </developer>
  </developers>
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/redfish4ktc/redfish4ktc-maven-parent/issues</url>
  </issueManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java_minimum_supported_version>1.6</java_minimum_supported_version>
    <maven_minimum_required_version>2.2.1</maven_minimum_required_version>

    <!-- plugin versions -->
    <plugin_failsafe_version>2.18</plugin_failsafe_version>
    <plugin_surefire_version>${plugin_failsafe_version}</plugin_surefire_version>
    <plugin_tomcat_version>2.2</plugin_tomcat_version>

    <!-- plugin configuration-->
    <plugin_animal_sniffer_skip>false</plugin_animal_sniffer_skip>
    <plugin_animal_sniffer_signature_groupId>org.codehaus.mojo.signature</plugin_animal_sniffer_signature_groupId>
    <plugin_animal_sniffer_signature_artifactId>java16</plugin_animal_sniffer_signature_artifactId>
    <plugin_animal_sniffer_signature_version>1.1</plugin_animal_sniffer_signature_version>
    <plugin_enforcer_fail_on_wrong_bytecode_version>true</plugin_enforcer_fail_on_wrong_bytecode_version>
    <plugin_surefire_failsafe_redirectTestOutputToFile>true</plugin_surefire_failsafe_redirectTestOutputToFile>
  </properties>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <filtering>false</filtering>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.5.1</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.2</version>
          <configuration>
            <source>${java_minimum_supported_version}</source>
            <target>${java_minimum_supported_version}</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.9</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
          <configuration>
            <deployAtEnd>true</deployAtEnd>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-ear-plugin</artifactId>
          <version>2.9.1</version>
          <!-- TODO duplicated with the jar plugin -->
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Project-build-date>${buildnumber-date}</Project-build-date>
                <Project-build-scm-branch>${buildnumber-scm-branch}</Project-build-scm-branch>
                <Project-build-scm-changeset>${buildnumber-scm-changeset}</Project-build-scm-changeset>
                <Project-url>${project.url}</Project-url>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${plugin_failsafe_version}</version>
          <configuration>
            <redirectTestOutputToFile>${plugin_surefire_failsafe_redirectTestOutputToFile}</redirectTestOutputToFile>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <!-- 1.5 make maven 3.2.x hang when running on windows with gpg tools available in git bash -->
          <version>1.4</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-invoker-plugin</artifactId>
          <version>1.9</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
          <configuration>
            <installAtEnd>true</installAtEnd>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.1</version>
          <!-- TODO duplicated with the jar plugin -->
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Project-build-date>${buildnumber-date}</Project-build-date>
                <Project-build-scm-branch>${buildnumber-scm-branch}</Project-build-scm-branch>
                <Project-build-scm-changeset>${buildnumber-scm-changeset}</Project-build-scm-changeset>
                <Project-url>${project.url}</Project-url>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.5</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Project-build-date>${buildnumber-date}</Project-build-date>
                <Project-build-scm-branch>${buildnumber-scm-branch}</Project-build-scm-branch>
                <Project-build-scm-changeset>${buildnumber-scm-changeset}</Project-build-scm-changeset>
                <Project-url>${project.url}</Project-url>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <goals>deploy</goals>
            <localCheckout>true</localCheckout>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <pushChanges>false</pushChanges>
            <releaseProfiles>sonatype-oss-release</releaseProfiles>
            <useReleaseProfile>false</useReleaseProfile>
          </configuration>
        </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-site-plugin</artifactId>
          <version>3.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
          <!-- TODO duplicated with the jar plugin -->
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Project-build-date>${buildnumber-date}</Project-build-date>
                <Project-build-scm-branch>${buildnumber-scm-branch}</Project-build-scm-branch>
                <Project-build-scm-changeset>${buildnumber-scm-changeset}</Project-build-scm-changeset>
                <Project-url>${project.url}</Project-url>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${plugin_surefire_version}</version>
          <configuration>
            <redirectTestOutputToFile>${plugin_surefire_failsafe_redirectTestOutputToFile}</redirectTestOutputToFile>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.5</version>
          <!-- TODO duplicated with the jar plugin -->
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Project-build-date>${buildnumber-date}</Project-build-date>
                <Project-build-scm-branch>${buildnumber-scm-branch}</Project-build-scm-branch>
                <Project-build-scm-changeset>${buildnumber-scm-changeset}</Project-build-scm-changeset>
                <Project-url>${project.url}</Project-url>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.11</version>
        </plugin>
        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat6-maven-plugin</artifactId>
          <version>${plugin_tomcat_version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>${plugin_tomcat_version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>animal-sniffer-maven-plugin</artifactId>
          <version>1.12</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>1.3</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.9.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>templating-maven-plugin</artifactId>
          <version>1.0-alpha-3</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[${maven_minimum_required_version},)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[${java_minimum_supported_version},)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-bytecode-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <!-- http://mojo.codehaus.org/extra-enforcer-rules/enforceBytecodeVersion.html -->
                <enforceBytecodeVersion>
                  <maxJdkVersion>${java_minimum_supported_version}</maxJdkVersion>
                </enforceBytecodeVersion>
              </rules>
              <fail>${plugin_enforcer_fail_on_wrong_bytecode_version}</fail>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>extra-enforcer-rules</artifactId>
            <version>1.0-beta-3</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-buildnumber-scm</id>
            <phase>initialize</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
          <scmBranchPropertyName>buildnumber-scm-branch</scmBranchPropertyName>
          <buildNumberPropertyName>buildnumber-scm-changeset</buildNumberPropertyName>
          <timestampPropertyName>buildnumber-date</timestampPropertyName>
          <timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss.SSS Z}</timestampFormat>
          <locale>fr_FR</locale>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <configuration>
          <signature>
            <groupId>${plugin_animal_sniffer_signature_groupId}</groupId>
            <artifactId>${plugin_animal_sniffer_signature_artifactId}</artifactId>
            <version>${plugin_animal_sniffer_signature_version}</version>
          </signature>
          <skip>${plugin_animal_sniffer_skip}</skip>
        </configuration>
        <executions>
          <execution>
            <id>animal-sniffer-check</id>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <properties>
        <maven_minimum_required_version>3.2.3</maven_minimum_required_version>
      </properties>
      <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.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>
  </profiles>

</project>
