<?xml version="1.0" encoding="UTF-8"?>
<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>
 <parent>
    <groupId>net.stickycode.parent</groupId>
    <artifactId>sticky-parent-distribution8</artifactId>
    <version>2.3</version>
  </parent>
  <groupId>net.stickycode.tile</groupId>
  <artifactId>sticky-tile-release</artifactId>
  <version>1.14</version>
  <packaging>tile</packaging>

  <name>sticky-tile-release-1</name>
  <description>Tile for configuring the release process for projects</description>
  <url>https://github.com/StickySource/sticky-tile-release</url>

  <scm>
    <connection>${git.url}</connection>
    <tag>sticky-tile-release-1.14</tag>
  </scm>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <version>2.5.3</version>
    </dependency>

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

    <dependency>
      <groupId>net.stickycode.plugins</groupId>
      <artifactId>bounds-maven-plugin</artifactId>
      <version>2.7</version>
    </dependency>

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

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

    <dependency>
      <groupId>io.repaint.maven</groupId>
      <artifactId>tiles-maven-plugin</artifactId>
      <version>2.9</version>
    </dependency>
  </dependencies>

  <build>
    <directory>${output.basedir}/${target.dir}</directory>
    <outputDirectory>${output.basedir}/${target.dir}/classes</outputDirectory>
    <testOutputDirectory>${output.basedir}/${target.dir}/test-classes</testOutputDirectory>
    <plugins>
      <plugin>
        <groupId>io.repaint.maven</groupId>
        <artifactId>tiles-maven-plugin</artifactId>
        <version>2.10</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
          <configuration>
            <preparationGoals>clean validate bounds:update verify</preparationGoals>
            <goals>validate deploy</goals>
            <suppressCommitBeforeTag>false</suppressCommitBeforeTag>
            <localCheckout>true</localCheckout>
            <tagNameFormat>@{project.artifactId}-@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <configuration>
            <archive>
              <addMavenDescriptor>false</addMavenDescriptor>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>net.stickycode.plugins</groupId>
          <artifactId>bounds-maven-plugin</artifactId>
          <version>2.7</version>
        </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-clean-plugin</artifactId>
          <version>3.0.0</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-enforcer-plugin</artifactId>
          <version>1.4.1</version>
          <executions>
            <execution>
              <phase>verify</phase>
              <id>enforcer-verification</id>
              <!-- Invocation is defined by the release plugin goal set hence no executions -->
              <configuration>
                <rules>
                  <requireReleaseDeps>
                    <message>
                      No SNAPSHOTs allowed in depedency tree or parents allowed when
                      releasing!
                    </message>
                    <failWhenParentIsSnapshot>true</failWhenParentIsSnapshot>
                    <searchTransitive>true</searchTransitive>
                  </requireReleaseDeps>
                </rules>
              </configuration>
            </execution>
            <execution>
              <id>enforcer-validation</id>
              <phase>validate</phase>
              <configuration>
                <rules>
                  <!-- Don't allow accidental inclusion of commons logging or log4j -->

                  <bannedDependencies>
                    <message>
                      Please ensure you exclude all dependencies on logging
                      implementations
                    </message>
                    <excludes>
                      <exclude>commons-logging</exclude>
                      <exclude>commons-logging-api</exclude>
                      <exclude>log4j:log4j</exclude>
                    </excludes>
                  </bannedDependencies>
                  <requireMavenVersion>
                    <version>[3.3.9,)</version>
                  </requireMavenVersion>
                  <requireJavaVersion>
                    <version>1.8.0</version>
                  </requireJavaVersion>
                </rules>
                <fail>true</fail>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.3</version>
          <configuration>
            <generateBackupPoms>false</generateBackupPoms>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>sign-release-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>promote-to-central</id>
      <distributionManagement>
        <repository>
          <uniqueVersion>false</uniqueVersion>
          <name>Sonatype Oss Staging</name>
          <id>sonatype-nexus-staging</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <uniqueVersion>true</uniqueVersion>
          <name>Sonatype Oss Snapshots</name>
          <id>sonatype-nexus-snapshots</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
  </profiles>
</project>

