<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>org.reaktivity</groupId>
  <artifactId>nukleus</artifactId>
  <version>0.21</version>
  <name>Nukleus API</name>
  <description>Nukleus API</description>
  <url>https://github.com/reaktivity/nukleus.java</url>

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

  <developers>
    <developer>
      <id>reaktivity.org</id>
      <name>The Reaktivity Project Contributors</name>
      <url>http://reaktivity.org/</url>
      <organization>The Reaktivity Project</organization>
      <organizationUrl>http://reaktivity.org/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/reaktivity/nukleus.java</connection>
    <developerConnection>scm:git:https://github.com/reaktivity/nukleus.java</developerConnection>
    <url>https://github.com/reaktivity/nukleus.java</url>
  </scm>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <checkstyle.config.location>src/conf/checkstyle/configuration.xml</checkstyle.config.location>
    <checkstyle.suppressions.location>src/conf/checkstyle/suppressions.xml</checkstyle.suppressions.location>
    <jacoco.coverage.ratio>0.24</jacoco.coverage.ratio>
    <jacoco.missed.count>8</jacoco.missed.count>

    <agrona.version>0.5.5</agrona.version>
    <junit.version>4.12</junit.version>
    <k3po.version>3.0.0-alpha-88</k3po.version>
    <jmh.version>1.12</jmh.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.agrona</groupId>
      <artifactId>Agrona</artifactId>
      <version>${agrona.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kaazing</groupId>
      <artifactId>k3po.junit</artifactId>
      <version>${k3po.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kaazing</groupId>
      <artifactId>k3po.lang</artifactId>
      <version>${k3po.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>${jmh.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>${jmh.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <header>COPYRIGHT</header>
          <properties>
            <copyrightYears>2016-2017</copyrightYears>
          </properties>
          <includes>
            <include>src/**</include>
          </includes>
          <excludes>
            <exclude>src/conf/**</exclude>
          </excludes>
          <failIfUnknown>true</failIfUnknown>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
        </configuration>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.9</version>
        <configuration>
          <rules>
            <rule>
              <element>BUNDLE</element>
              <limits>
                <limit>
                  <counter>INSTRUCTION</counter>
                  <value>COVEREDRATIO</value>
                  <minimum>${jacoco.coverage.ratio}</minimum>
                </limit>
                <limit>
                  <counter>CLASS</counter>
                  <value>MISSEDCOUNT</value>
                  <maximum>${jacoco.missed.count}</maximum>
                </limit>
              </limits>
            </rule>
          </rules>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <argLine>@{argLine}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.kaazing</groupId>
        <artifactId>k3po-maven-plugin</artifactId>
        <version>${k3po.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>start</goal>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <argLine>@{argLine}</argLine>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.gatling</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.4.2</version>
        <configuration>
          <shadeTestJar>true</shadeTestJar>
          <outputFile>${project.build.directory}/${project.artifactId}-shaded.jar</outputFile>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>org.openjdk.jmh.Main</mainClass>
                  <manifestEntries>
                    <Class-Path>${project.build.directory}/${project.artifactId}-shaded.jar</Class-Path>
                  </manifestEntries>
                </transformer>
              </transformers>
              <artifactSet>
                <includes>
                  <include>org.agrona:Agrona</include>
                  <include>org.reaktivity:nukleus</include>
                  <include>org.reaktivity:reaktor</include>
                  <include>org.openjdk.jmh:jmh-core</include>
                  <include>net.sf.jopt-simple:jopt-simple</include>
                  <include>org.apache.commons:commons-math3</include>
                  <include>commons-cli:commons-cli</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>

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

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <phase>validate</phase>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</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>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
