<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>nats-parent</artifactId>
    <groupId>io.nats</groupId>
    <version>1.13</version>
    <relativePath>../pom.xml/pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.nats</groupId>
  <artifactId>java-nats-streaming</artifactId>
  <packaging>bundle</packaging>
  <name>java-nats-streaming</name>
  <version>0.5.0</version>
  <description>Java client library for NATS Streaming</description>
  <url>https://github.com/nats-io/java-nats-streaming</url>
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/nats-io/java-nats-streaming/issues/</url>
  </issueManagement>
  <ciManagement>
    <system>Travis</system>
    <url>https://travis-ci.org/nats-io/java-nats-streaming/</url>
  </ciManagement>
  <inceptionYear>2016</inceptionYear>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/nats-io/java-nats-streaming.git</connection>
    <developerConnection>scm:git:git@github.com:nats-io/java-nats-streaming.git</developerConnection>
    <tag>0.5.0</tag>
    <url>https://github.com/nats-io/java-nats-streaming</url>
  </scm>
  <organization>
    <name>Apcera, Inc.</name>
    <url>http://nats.io</url>
  </organization>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-protoc</id>
            <phase>initialize</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.google.protobuf</groupId>
                  <artifactId>protoc</artifactId>
                  <version>${protobuf-java-version}</version>
                  <classifier>${os.detected.classifier}</classifier>
                  <type>exe</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>exec-protoc</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <property />
                <property />
                <chmod />
                <mkdir />
                <path>
                  <fileset>
                    <include />
                  </fileset>
                </path>
                <pathconvert />
                <exec>
                  <arg />
                  <arg />
                  <arg />
                  <arg />
                  <arg />
                  <arg />
                  <arg />
                </exec>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>copy-server</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <condition>
                  <available />
                </condition>
                <echo />
                <echo />
                <get />
                <unzip />
                <move />
                <chmod />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-classes</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${protobuf.output.directory}</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>pre-unit-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <destFile>${jacoco.ut.execution.data.file}</destFile>
              <propertyName>surefireArgLine</propertyName>
            </configuration>
          </execution>
          <execution>
            <id>post-unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>${jacoco.ut.execution.data.file}</dataFile>
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
              <excludes>
                <exclude>io/nats/streaming/protobuf/*.class</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>pre-integration-test</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <destFile>${jacoco.it.execution.data.file}</destFile>
              <propertyName>failsafeArgLine</propertyName>
            </configuration>
          </execution>
          <execution>
            <id>post-integration-test</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>${jacoco.it.execution.data.file}</dataFile>
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
              <excludes>
                <exclude>io/nats/streaming/protobuf/*.class</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${skip.unit.tests}</skip>
              <groups>io.nats.streaming.UnitTest</groups>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <argLine>${surefireArgLine}</argLine>
          <skipTests>${skip.unit.tests}</skipTests>
          <excludes>
            <exclude>**/IT*.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-tests</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <argLine>${failsafeArgLine}</argLine>
              <skipTests>${skip.integration.tests}</skipTests>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
        <configuration>
          <jacocoFile>${jacoco.ut.execution.data.file}</jacocoFile>
          <jacocoReports>
            <param>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</param>
          </jacocoReports>
          <coverageFile>${jacoco.ut.execution.data.file}</coverageFile>
          <sourceEncoding>${project.reporting.sourceEncoding}</sourceEncoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <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>java-nats-streaming:${project.version}</header>
              <footer>java-nats-streaming:${project.version}</footer>
              <doctitle>java-nats-streaming
                                (${project.version})</doctitle>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <header>java-nats-streaming:${project.version}</header>
          <footer>java-nats-streaming:${project.version}</footer>
          <author>false</author>
          <doctitle>${project.name} (${project.version})</doctitle>
          <docfilessubdirs>true</docfilessubdirs>
          <additionalJOption>-J-Xmx1024m</additionalJOption>
          <excludePackageNames>io.nats.streaming.protobuf</excludePackageNames>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <arg>-Xlint:all,-options,-path</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <pattern>com.google.protobuf</pattern>
                  <shadedPattern>shaded.nats.com.google.protobuf</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>ossrh</id>
      <build>
        <plugins>
          <plugin>
            <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>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>injected-nexus-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <serverId>ossrh</serverId>
                  <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                  <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <os.detected.name>osx</os.detected.name>
        <gpg.secretKeyring2>${env.GPG_DIR}/secring.gpg</gpg.secretKeyring2>
        <gpg.publicKeyring2>${env.GPG_DIR}/pubring.gpg</gpg.publicKeyring2>
        <Xgpg.executable>/usr/local/Cellar/gnupg/2.0.29/bin/gpg2</Xgpg.executable>
        <gpg.defaultKeyring>true</gpg.defaultKeyring>
        <os.detected.arch>x86_64</os.detected.arch>
        <os.detected.classifier>osx-x86_64</os.detected.classifier>
        <gpg.secretKeyring>/Users/colinsullivan/.gnupg/secring.gpg</gpg.secretKeyring>
        <gpg.keyname>colin.sullivan@apcera.com</gpg.keyname>
        <gpg.publicKeyring>/Users/colinsullivan/.gnupg/pubring.gpg</gpg.publicKeyring>
      </properties>
    </profile>
    <profile>
      <id>benchTests</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <groups>io.nats.streaming.BenchmarkTest</groups>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>all-tests</id>
      <properties>
        <skip.unit.tests>false</skip.unit.tests>
        <build.profile.id>all-tests</build.profile.id>
        <skip.integration.tests>false</skip.integration.tests>
      </properties>
    </profile>
    <profile>
      <id>dev</id>
    </profile>
    <profile>
      <id>integration-test</id>
      <properties>
        <skip.unit.tests>true</skip.unit.tests>
        <build.profile.id>integration-test</build.profile.id>
        <skip.integration.tests>false</skip.integration.tests>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>21.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.6.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <dependencyManagement />
  <properties>
    <server.exec.pkg.url>https://github.com/nats-io/${server.exec.name}/releases/download/v${server.version}/${server.exec.pkg}.zip</server.exec.pkg.url>
    <server.exec.pkg>${server.exec.name}-v${server.version}-${nats.os}-${nats.arch}</server.exec.pkg>
    <jacoco.it.execution.data.file>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
    <protobuf.output.directory>${project.build.directory}/generated-sources</protobuf.output.directory>
    <jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.ut.execution.data.file>
    <server.exec.name>nats-streaming-server</server.exec.name>
    <java-nats-version>1.1-SNAPSHOT</java-nats-version>
    <protobuf.input.directory>${project.basedir}/src/main/proto</protobuf.input.directory>
    <maven.compiler.target>1.8</maven.compiler.target>
    <skip.unit.tests>false</skip.unit.tests>
    <server.version>0.3.8</server.version>
    <skip.integration.tests>true</skip.integration.tests>
    <build.profile.id>dev</build.profile.id>
    <maven.compiler.source>1.8</maven.compiler.source>
  </properties>
</project>

