<!--
    Copyright (c) 2015-2016 Apcera Inc.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the MIT License (MIT)
    which accompanies this distribution, and is available at
    http://opensource.org/licenses/MIT
 -->
<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>

	<parent>
		<groupId>org.sonatype.oss</groupId>
		<artifactId>oss-parent</artifactId>
		<version>9</version>
	</parent>

	<groupId>io.nats</groupId>
	<artifactId>jnats</artifactId>
	<version>0.3.2</version>

	<name>jnats</name>
	<description>Java client library for NATS Messaging System</description>
	<url>https://github.com/nats-io/jnats</url>
	<inceptionYear>2015</inceptionYear>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.sourceEncoding>UTF-8</project.reporting.sourceEncoding>
		<java.version>1.7</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.7.5</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>1.7.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>2.0.31-beta</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
	    <profile>
	        <id>unitTests</id>
	        <activation>
	            <activeByDefault>true</activeByDefault>
	        </activation>
	        <build>
	            <plugins>
	                <plugin>
	                    <groupId>org.apache.maven.plugins</groupId>
	                    <artifactId>maven-surefire-plugin</artifactId>
	                    <configuration>
	                        <groups>io.nats.client.UnitTest</groups>
	                    </configuration>
	                </plugin>
	            </plugins>
	        </build>
	    </profile>
	    <profile>
	        <id>benchTests</id>
	        <build>
	            <plugins>
	                <plugin>
	                    <groupId>org.apache.maven.plugins</groupId>
	                    <artifactId>maven-surefire-plugin</artifactId>
	                    <configuration>
	                        <groups>io.nats.client.BenchmarkTest</groups>
	                    </configuration>
	                </plugin>
	            </plugins>
	        </build>
	    </profile>
	</profiles>
	<build>
		<plugins>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.3</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.6</version>
				<configuration>
					<useAgent>false</useAgent>
				</configuration>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19</version>
				<configuration>
					<!-- Sets the VM argument line used when unit tests are run. -->
					<argLine>${surefireArgLine}</argLine>
					<!-- Skips unit tests if the value of skip.unit.tests property is true -->
					<skipTests>${skip.unit.tests}</skipTests>
					<!-- Excludes integration tests when unit tests are run. -->
					<excludes>
					    <exclude>**/IT*.java</exclude>
					</excludes>
					<!-- Includes specific categories when unit tests are run. -->
					<groups>io.nats.client.UnitTest</groups>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.3</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.7.5.201505241946</version>
				<executions>
					<!-- 
						Prepares the property pointing to the JaCoCo runtime agent which 
						is passed as VM argument when Maven the Surefire plugin is executed. 
					-->
					<execution>
						<id>pre-unit-test</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<!-- Sets the path to the file which contains the execution data. -->
							<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
							<!-- 
								Sets the name of the property containing the settings for JaCoCo 
								runtime agent. 
							-->
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
			        <!--
			            Ensures that the code coverage report for unit tests is created after
			            unit tests have been run.
			        -->
			        <execution>
			            <id>post-unit-test</id>
			            <phase>test</phase>
			            <goals>
			                <goal>report</goal>
			            </goals>
			            <configuration>
			                <!-- Sets the path to the file which contains the execution data. -->
			                <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
			                <!-- Sets the output directory for the code coverage report. -->
			                <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
			            </configuration>
			        </execution>
					<execution>
						<id>default-check</id>
						<goals>
							<goal>check</goal>
						</goals>
						<configuration>
							<rules>
								<rule implementation="org.jacoco.maven.RuleConfiguration">
									<element>BUNDLE</element>
									<limits>
										<limit implementation="org.jacoco.report.check.Limit">
											<counter>COMPLEXITY</counter>
											<value>COVEREDRATIO</value>
											<minimum>0.80</minimum>
										</limit>
									</limits>
								</rule>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.eluder.coveralls</groupId>
				<artifactId>coveralls-maven-plugin</artifactId>
				<version>2.2.0</version>
				<configuration>
					<sourceEncoding>UTF8</sourceEncoding>
				</configuration>
			</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</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.3</version>
				<configuration>
					<header>jnats ${project.version}</header>
					<footer>jnats ${project.version}</footer>
					<author>false</author>
					<doctitle>${project.name} (${project.version})</doctitle>
<!-- 					
					<stylesheetfile>${basedir}/src/main/javadoc/kenai-stylesheet.css</stylesheetfile>
					<javadocDirectory>${basedir}/src/main/javadoc</javadocDirectory>  
 -->					
 					<docfilessubdirs>true</docfilessubdirs>  
					<additionalJOption>-J-Xmx1024m</additionalJOption>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
							<goal>aggregate</goal>
						</goals>
						<configuration>
							<failOnError>true</failOnError>
							<show>public</show>
							<nohelp>true</nohelp>
							<header>jnats ${project.version}</header>
							<footer>jnats ${project.version}</footer>
							<doctitle>jnats ${project.version}</doctitle>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-scm-publish-plugin</artifactId>
				<version>1.1</version>
				<configuration>
					<checkoutDirectory>${project.build.directory}/scmpublish</checkoutDirectory>
					<checkinComment>Publishing javadoc for
						${project.artifactId}:${project.version}</checkinComment>
					<content>${project.reporting.outputDirectory}/apidocs</content>
					<skipDeletedFiles>true</skipDeletedFiles>
					<pubScmUrl>scm:git:git@github.com:nats-io/jnats.git</pubScmUrl>
					<scmBranch>gh-pages</scmBranch> <!-- branch with static site -->
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.5.3</version>
					<configuration>
						<useReleaseProfile>true</useReleaseProfile>
						<releaseProfiles>release</releaseProfiles>
						<allowTimestampedSnapshots>true</allowTimestampedSnapshots>
						<autoVersionSubmodules>true</autoVersionSubmodules>
						<localCheckout>true</localCheckout>
						<pushChanges>false</pushChanges>
						<goals>deploy</goals>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
	</build>

	<issueManagement>
		<url>https://github.com/nats-io/jnats/issues/</url>
		<system>GitHub Issues</system>
	</issueManagement>

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

	<scm>
		<url>https://github.com/nats-io/jnats</url>
		<connection>scm:git:git://github.com/nats-io/jnats.git</connection>
		<developerConnection>scm:git:git@github.com:nats-io/jnats.git</developerConnection>
	  <tag>jnats-0.3.2</tag>
  </scm>

	<organization>
		<url>http://nats.io</url>
		<name>Apcera, Inc.</name>
	</organization>

	<developers>
		<developer>
			<id>larry</id>
			<name>Larry McQueary</name>
			<email>larry@apcera.com</email>
			<url>https://github.com/mcqueary/</url>
			<organization>Apcera Inc.</organization>
			<organizationUrl>http://www.apcera.com</organizationUrl>
			<roles>
				<role>Product Manager</role>
				<role>Developer</role>
			</roles>
			<timezone>America/Denver</timezone>
			<properties>
				<picUrl>http://www.example.com/jdoe/pic</picUrl>
			</properties>
		</developer>
	</developers>

	<ciManagement>
		<system>Travis</system>
		<url>https://travis-ci.org/nats-io/jnats/</url>
	</ciManagement>

	<mailingLists>
		<mailingList>
			<name>nats</name>
			<archive>https://groups.google.com/group/natsio/</archive>
			<subscribe>natsio+subscribe@googlegroups.com</subscribe>
			<unsubscribe>natsio+unsubscribe@googlegroups.com</unsubscribe>
			<post>natsio@googlegroups.com</post>
		</mailingList>
	</mailingLists>

	<distributionManagement>
		<repository>
			<id>ossrh</id>
			<name>Sonatype OSS Staging</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
		<snapshotRepository>
			<id>ossrh</id>
			<name>Sonatype OSS Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

</project>
