<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.bluetrainsoftware.parent</groupId>
  <artifactId>central-parent</artifactId>
  <version>1.1</version>
  <packaging>pom</packaging>

  <name>Blue Train Software Ltd - Central Parent</name>

  <description>Maven Parent for BTS Artifacts that will be going into Maven Central.</description>

  <url>http://www.bluetrainsoftware.com</url>
  <developers>
    <developer>
      <email>richard@bluetrainsoftware.com</email>
      <id>rvowles</id>
      <name>Richard Vowles</name>
      <organization>Blue Train Software Ltd</organization>

    </developer>
  </developers>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:rvowles/central-parent.git</connection>
    <developerConnection>scm:git:git@github.com:rvowles/central-parent.git</developerConnection>
    <url>git@github.com:rvowles/central-parent.git</url>
    <tag>central-parent-1.1</tag>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.version>3.0.4</maven.version>
    <bts.release>dev</bts.release>
  </properties>

  <distributionManagement>
    <repository>
      <id>sonatype-staging</id>
      <name>oss.sonatype.org Staging Repository</name>
      <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-snapshots</id>
      <name>oss.sonatype.org Snapshot Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <profiles>
    <profile>
      <!-- adtivate the sonatype profile when a release is being done -->
      <id>sonaytpe</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.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>1.8.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.2</version>
          <configuration>
            <rules>
              <requireMavenVersion>
                <version>[3.0.4,)</version>
              </requireMavenVersion>
              <requireReleaseDeps>
                <!--  Don't allow releases with snapshop deps or parents -->
                <message>No Snapshots Allowed!</message>
                <failWhenParentIsSnapshot>true</failWhenParentIsSnapshot>
                <searchTransitive>true</searchTransitive>
              </requireReleaseDeps>
              <!-- Don't allow accidental inclusion of commons logging or log4j -->
              <bannedDependencies>
                <excludes>
                  <exclude>commons-logging</exclude>
                  <exclude>commons-logging-api</exclude>
                </excludes>
              </bannedDependencies>
            </rules>
            <fail>true</fail>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.4.1</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <arguments>-Dbts.release=release</arguments>
            <preparationGoals>clean enforcer:enforce verify</preparationGoals>
            <goals>enforcer:enforce deploy</goals>
            <tagBase>release/${project.groupId}/</tagBase>
            <pushChanges>false</pushChanges>
            <localCheckout>true</localCheckout>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <source>1.7</source>
            <target>1.7</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.5</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
