<?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>

  <groupId>net.stickycode.tile</groupId>
  <artifactId>sticky-tile-release</artifactId>
  <version>2.8</version>
  <packaging>tile</packaging>

  <name>sticky-tile-release</name>
  <description>Tile for configuring the release process for projects</description>
  <url>https://github.com/StickySource/sticky-tile-release</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>

  <properties>
    <git.base.url>scm:git:git@github.com</git.base.url>
    <git.branchout.name>StickySource</git.branchout.name>
    <git.url>${git.base.url}:${git.branchout.name}/${project.artifactId}.git</git.url>
    <project.build.sourceEncoding>US-ASCII</project.build.sourceEncoding>
    <target.dir>target</target.dir>
    <output.basedir>${basedir}</output.basedir>
  </properties>

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

  <developers>
    <developer>
      <email>michael@StickyCode.net</email>
      <id>michael@StickyCode.net</id>
      <name>Michael McCallum</name>
      <roles>
        <role>founder</role>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <organization>Red Engine Ltd</organization>
      <organizationUrl>http://www.RedEngine.co.nz</organizationUrl>
      <timezone>+12</timezone>
    </developer>
  </developers>

  <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.34</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>4.11</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 other than slf4j
                    </message>
                    <excludes>
                      <exclude>commons-logging</exclude>
                      <exclude>commons-logging-api</exclude>
                      <exclude>log4j:log4j</exclude>
                    </excludes>
                  </bannedDependencies>
                  <requireMavenVersion>
                    <version>[3.5.0,)</version>
                  </requireMavenVersion>
                </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>3.0.1</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>

