<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->

<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">
<!--
  TODO - Uncomment when/if we become a contrib project to org.apache.qpid:proton-project
         Note that proton-project pom.xml will also require updating to add: <module>contrib/mqlight/java/mqlight-project</module>
  <parent>
    <groupId>org.apache.qpid</groupId>
    <artifactId>proton-project</artifactId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../../..</relativePath>
  </parent>
-->

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.ibm.mqlight</groupId>
  <artifactId>mqlight-project</artifactId>
  <version>1.0.2015052200</version>
  <packaging>pom</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>MQ Light Java API and Samples.</description>
  <url>https://developer.ibm.com/messaging/mq-light</url>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <organization>
    <name>International Business Machines Corporation</name>
    <url>http://www.ibm.com/</url>
  </organization>
  
  <developers>
    <developer>
      <name>Dominic Evans</name>
      <email>dominic.evans@uk.ibm.com</email>
      <organization>International Business Machines Corporation</organization>
      <organizationUrl>http://www.ibm.com/</organizationUrl>
    </developer>
    <developer>
      <name>Chris White</name>
      <email>chris.white@uk.ibm.com</email>
      <organization>International Business Machines Corporation</organization>
      <organizationUrl>http://www.ibm.com/</organizationUrl>
    </developer>
    <developer>
      <name>Laurence Bonney</name>
      <email>BONNEYL@uk.ibm.com</email>
      <organization>International Business Machines Corporation</organization>
      <organizationUrl>http://www.ibm.com/</organizationUrl>
    </developer>
  </developers>
  
  <scm>
    <connection>scm:git:git@github.com:mqlight/java-mqlight.git</connection>
    <developerConnection>scm:git:git@github.com:mqlight/java-mqlight.git</developerConnection>
    <url>git@github.com:mqlight/java-mqlight.git</url>
  </scm>
  
  <modules>
    <module>mqlight</module>
    <module>mqlight-samples</module>
    <module>mqlight-distribution</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <github.global.server>github</github.global.server>
  </properties>

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

    <site>
      <id>github-project-site</id>
      <name>Deployment through GitHub's site deployment plugin</name>
      <url>>${project.version}</url>
    </site>
  </distributionManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.2</version>
          <configuration>
            <source>1.7</source>
            <target>1.7</target>
            <optimize>true</optimize>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.6</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
            </archive>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>3.0.0</version>
          <configuration>
            <excludeFilterFile>${basedir}/../findbugs.excludes.xml</excludeFilterFile>
            <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
          </configuration>
          <executions>
            <execution>
              <id>findbugs</id>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>xml-maven-plugin</artifactId>
          <version>1.0</version>
          <executions>
            <execution>
              <id>findbugs-html-report</id>
              <phase>compile</phase>
              <goals>
                <goal>transform</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <transformationSets>
              <transformationSet>
                <dir>${project.build.directory}/findbugs</dir>
                <outputDir>${project.build.directory}/findbugs</outputDir>
                <stylesheet>fancy.xsl</stylesheet>
                <fileMappers>
                  <fileMapper
                    implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
                    <pattern>Xml\.xml$</pattern>
                    <replacement>.html</replacement>
                  </fileMapper>
                </fileMappers>
              </transformationSet>
            </transformationSets>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.google.code.findbugs</groupId>
              <artifactId>findbugs</artifactId>
              <version>2.0.0</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.7.4.201502262128</version>
          <configuration>
            <outputDirectory>${project.build.directory}/jacoco</outputDirectory>
            <destFile>${project.build.directory}/jacoco/jacoco-unit.exec</destFile>
            <dataFile>${project.build.directory}/jacoco/jacoco-unit.exec</dataFile>
          </configuration>
          <executions>
            <execution>
              <id>jacoco-initialize</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-test-report</id>
              <phase>test</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-test-check</id>
              <phase>test</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <rules>
                  <rule>
                    <element>BUNDLE</element>
                    <limits>
                      <limit>
                        <counter>INSTRUCTION</counter>
                        <value>COVEREDRATIO</value>
                        <minimum>0.80</minimum>
                      </limit>
                    </limits>
                  </rule>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
      
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.1</version>
          <configuration>
            <excludePackageNames>com.ibm.mqlight.api.impl</excludePackageNames>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18.1</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.8</version>
        </plugin>

      </plugins>
    </pluginManagement>
    
    <plugins>
      <!-- Generate a source jar for projects that contain source -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      
      <!-- Generate a javadoc jar containing doc for all modules (required to enable 
        publishing to a single javadoc site) -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <excludePackageNames>com.ibm.mqlight.api.impl</excludePackageNames>
        </configuration>
        <executions>
          <execution>
            <id>aggregate-javadocs</id>
            <goals>
              <goal>aggregate-jar</goal>
            </goals>
           <phase>site</phase>
          </execution>
        </executions>
      </plugin>

      <!-- Sign the project artifacts for all modules -->
      <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>
            <configuration>
              <defaultKeyring>false</defaultKeyring>
              <keyname>mqlight</keyname>
              <passphraseServerId>mqlight</passphraseServerId>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Deploy and Release to Maven Central
           command: mvn clean deploy - to deploy to OSSRH
                    mvn nexus-staging:release - to release to Maven Central (when version does not end in -SNAPSHOT)
      -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.5</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>false</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
