<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.rabbitmq</groupId>
  <artifactId>tracer</artifactId>
  <version>1.0.0</version>
  <packaging>jar</packaging>

  <name>RabbitMQ AMQP Tracer</name>
  <description>A Java-based AMQP protocol analyzer.</description>
  <url>http://www.rabbitmq.com</url>

  <licenses>
    <license>
      <name>ASL 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>GPL v2</name>
      <url>http://www.gnu.org/licenses/gpl-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>MPL 1.1</name>
      <url>http://www.mozilla.org/MPL/MPL-1.1.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <email>info@rabbitmq.com</email>
      <name>Team RabbitMQ</name>
      <organization>Pivotal Software, Inc.</organization>
      <organizationUrl>https://rabbitmq.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/rabbitmq/rabbitmq-tracer.git</url>
    <connection>scm:git:https://github.com/rabbitmq/rabbitmq-tracer.git</connection>
  </scm>

  <organization>
    <name>Pivotal Software, Inc.</name>
    <url>http://www.rabbitmq.com</url>
  </organization>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <rabbitmq.version>3.6.5</rabbitmq.version>
    <junit.version>4.12</junit.version>

    <!-- to sign artifacts when releasing -->
    <gpg.keyname>6026DFCA</gpg.keyname>
    <nexus-staging-maven-plugin.version>1.6.4</nexus-staging-maven-plugin.version>

  </properties>

  <profiles>

    <profile>
      <!--
      Java 8's Javadoc is way more sensible to documentation
      correctness. For now, disable all those errors until we fix them.
      -->
      <id>disable-java8-doclint</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>

    <profile>
      <!--
      The "ossrh-release" Maven profile is used to push release artifacts to a
      Sonatype staging repository.

      Add Sonatype credentials in the <servers> tag of Maven's settings.xml:

      <server>
        <id>ossrh</id>
        <username>[username]</username>
        <password>[password]</password>
      </server>

      Checkout the correct tag and launch:

      mvn clean deploy -P ossrh-release -DskipTests

      -->
      <id>ossrh-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <configuration>
              <additionalparam>${javadoc.opts}</additionalparam>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>package</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>${gpg.keyname}</keyname>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
    </profile>

    <!--
      The "milestone" Maven profile is used to push release artifacts to the
      Bintray Milestones Maven Repository.

      Add Bintray credentials in the <servers> tag of Maven's settings.xml:

      <server>
        <id>bintray-rabbitmq-maven-milestones</id>
        <username>[username]</username>
        <password>[api-key]</password>
      </server>

      Checkout the correct tag and launch:

      mvn clean deploy -P milestone -DskipTests

      -->
    <profile>
      <id>milestone</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <configuration>
              <additionalparam>${javadoc.opts}</additionalparam>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>package</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>${gpg.keyname}</keyname>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>bintray-rabbitmq-maven-milestones</id>
          <name>rabbitmq-maven-milestones</name>
          <url>https://api.bintray.com/maven/rabbitmq/maven-milestones/java-client/;publish=1</url>
        </repository>
      </distributionManagement>
    </profile>

    <profile>
      <!--
      The "assemblies" Maven profile is used to generate source
      and binary archives (to-be-uploaded on Github).
      -->
      <id>assemblies</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.6</version>
            <configuration>
              <finalName>rabbitmq-${project.build.finalName}</finalName>
              <descriptors>
                <descriptor>src/assembly/dist-bin.xml</descriptor>
                <descriptor>src/assembly/dist-src.xml</descriptor>
              </descriptors>
            </configuration>

            <executions>
              <execution>
                <id>create-archive</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>com.rabbitmq</groupId>
      <artifactId>amqp-client</artifactId>
      <version>${rabbitmq.version}</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    
    <plugins>
      
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <compilerArgs>
            <arg>-Xlint:deprecation</arg>
            <arg>-Xlint:unchecked</arg>
          </compilerArgs>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${nexus-staging-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <skipStaging>false</skipStaging>
        </configuration>
      </plugin>

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

    </plugins>
  </build>

</project>
