<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>uk.org.lidalia</groupId>
  <artifactId>oss-deployable</artifactId>
  <version>1.2.0</version>
  <packaging>pom</packaging>

  <name>POM providing configuration for an open source deployment to Sonatype</name>
  <description>Allows deployment to Sonatype</description>
  <url>https://github.com/Mahoney/oss-deployable</url>

  <licenses>
    <license>
      <name>MIT X11 License</name>
      <url>https://github.com/Mahoney/lidalia-parent/raw/master/X11-LICENSE.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/Mahoney/oss-deployable</url>
    <connection>scm:git:git@github.com:Mahoney/oss-deployable.git</connection>
    <developerConnection>scm:git:git@github.com:Mahoney/oss-deployable.git</developerConnection>
    <tag>oss-deployable-1.2.0</tag>
  </scm>

  <developers>
    <developer>
      <name>Robert Elliot</name>
      <email>rob@lidalia.org.uk</email>
      <roles>
        <role>Lead Developer</role>
      </roles>
    </developer>
  </developers>

  <prerequisites>
    <maven>2.2.1</maven>
  </prerequisites>

  <properties>
    <sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
    <maven-deploy-plugin.version>2.7</maven-deploy-plugin.version>
    <maven-install-plugin.version>2.4</maven-install-plugin.version>
    <maven-site-plugin.version>3.3</maven-site-plugin.version>
    <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>2.9</maven-javadoc-plugin.version>
    <maven-release-plugin.version>2.4.1</maven-release-plugin.version>
    <maven-enforcer-plugin.version>1.2</maven-enforcer-plugin.version>
    <maven-gpg-plugin.version>1.4</maven-gpg-plugin.version>
    <nexus-staging-maven-plugin-version>1.4.4</nexus-staging-maven-plugin-version>
    <maven-help-plugin.version>2.2</maven-help-plugin.version>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven-install-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven-site-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven-enforcer-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus-staging-maven-plugin-version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-help-plugin</artifactId>
          <version>${maven-help-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <distributionManagement>
        <repository>
          <id>sonatype-nexus-staging</id>
          <name>Nexus Release Repository</name>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
              <mavenExecutorId>forked-path</mavenExecutorId>
              <useReleaseProfile>false</useReleaseProfile>
              <arguments>-Psonatype-oss-release -Dgpg.passphrase="${gpg.passphrase}"</arguments>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-maven</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireMavenVersion>
                      <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                      <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>
                    </requireMavenVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <nexusUrl>https://oss.sonatype.org</nexusUrl>
              <serverId>sonatype-nexus-staging</serverId>
            </configuration>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                  <goal>release</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
