<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.datatorrent</groupId>
  <artifactId>netlet</artifactId>
  <version>1.2.0</version>
  <packaging>jar</packaging>

  <name>Netlet</name>
  <description>A networking library to facilitate a no-nonsense fast tcp nio</description>
  <url>http://www.datatorrent.com/product/netlet</url>

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

  <developers>
    <developer>
      <id>243826</id>
      <name>Chetan Narsude</name>
      <email>chetan@datatorrent.com</email>
      <organization>DataTorrent, Inc.</organization>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>vrozov</id>
      <name>Vlad Rozov</name>
      <email>v.rozov@datatorrent.com</email>
      <organization>DataTorrent, Inc.</organization>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:DataTorrent/Netlet.git</connection>
    <developerConnection>scm:git:git@github.com:DataTorrent/Netlet.git</developerConnection>
    <url>git@github.com:DataTorrent/Netlet.git</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <benchmark.count>1000000</benchmark.count>
    <benchmark.size>256</benchmark.size>
    <benchmark.host>localhost</benchmark.host>
    <benchmark.port>8080</benchmark.port>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-tools</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[1.6.0,)</version>
                </requireJavaVersion>
                <requireMavenVersion>
                  <version>[3.0.2,)</version>
                </requireMavenVersion>
                <requireReleaseDeps>
                  <message>Snapshots are not allowed</message>
                  <onlyWhenRelease>true</onlyWhenRelease>
                </requireReleaseDeps>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.14</version>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java16</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.siom79.japicmp</groupId>
        <artifactId>japicmp-maven-plugin</artifactId>
        <version>0.5.3</version>
        <configuration>
          <oldVersion>
            <dependency>
              <groupId>com.datatorrent</groupId>
              <artifactId>netlet</artifactId>
              <version>1.1.0</version>
            </dependency>
          </oldVersion>
          <newVersion>
            <file>
              <path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
            </file>
          </newVersion>
          <parameter>
            <onlyModified>true</onlyModified>
            <!-- includes>
              <include>package.to.include</include>
              <include>package.ClassToInclude</include>
              <include>package.Class#methodToInclude(long,int)</include>
              <include>package.Class#fieldToInclude</include>
            </includes>
            <excludes>
              <exclude>package.to.exclude</exclude>
              <exclude>package.ClassToExclude</exclude>
              <exclude>package.Class#methodToExclude(long,int)</exclude>
              <exclude>package.Class#fieldToExclude</exclude>
            </excludes -->
            <accessModifier>protected</accessModifier>
            <breakBuildOnModifications>false</breakBuildOnModifications>
            <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
            <onlyBinaryIncompatible>false</onlyBinaryIncompatible>
            <includeSynthetic>false</includeSynthetic>
            <ignoreMissingClasses>false</ignoreMissingClasses>
            <!-- skip>false</skip -->
          </parameter>
          <!-- dependencies>
            <dependency>
              <groupId>org.apache.commons</groupId>
              <artifactId>commons-math3</artifactId>
              <version>3.4</version>
            </dependency>
          </dependencies -->
          <skip>false</skip>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>cmp</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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.3</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</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.3</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>Benchmark Netlet Server</id>
      <activation>
        <property>
          <name>benchmark</name>
          <value>netlet.server</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-server</argument>
                <argument>-XX:+PrintGCDetails</argument>
                <argument>-Xms2g</argument>
                <argument>-Xmx2g</argument>
                <argument>-XX:NewSize=768m</argument>
                <argument>-XX:MaxNewSize=768m</argument>
                <argument>-cp</argument>
                <classpath />
                <argument>-Dcom.datatorrent.netlet.benchmark.message.count=${benchmark.count}</argument>
                <argument>-Dcom.datatorrent.netlet.benchmark.message.size=${benchmark.size}</argument>
                <argument>com.datatorrent.netlet.benchmark.netlet.EchoTcpServer</argument>
                <argument>${benchmark.port}</argument>
              </arguments>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>Benchmark Netty Server</id>
      <activation>
        <property>
          <name>benchmark</name>
          <value>netty.server</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-server</argument>
                <argument>-XX:+PrintGCDetails</argument>
                <argument>-Xms2g</argument>
                <argument>-Xmx2g</argument>
                <argument>-XX:NewSize=768m</argument>
                <argument>-XX:MaxNewSize=768m</argument>
                <argument>-cp</argument>
                <classpath />
                <argument>-Dcom.datatorrent.netlet.benchmark.message.count=${benchmark.count}</argument>
                <argument>-Dcom.datatorrent.netlet.benchmark.message.size=${benchmark.size}</argument>
                <argument>com.datatorrent.netlet.benchmark.netty.EchoTcpServer</argument>
                <argument>${benchmark.port}</argument>
              </arguments>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>Benchmark Netlet Client</id>
      <activation>
        <property>
          <name>benchmark</name>
          <value>netlet.client</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-server</argument>
                <argument>-verbose:gc</argument>
                <argument>-Xms1g</argument>
                <argument>-Xmx1g</argument>
                <argument>-XX:NewSize=512m</argument>
                <argument>-XX:MaxNewSize=512m</argument>
                <argument>-cp</argument>
                <classpath />
                <argument>-Dcom.datatorrent.netlet.benchmark.message.count=${benchmark.count}</argument>
                <argument>-Dcom.datatorrent.netlet.benchmark.message.size=${benchmark.size}</argument>
                <argument>com.datatorrent.netlet.benchmark.netlet.BenchmarkTcpClient</argument>
                <argument>${benchmark.host}</argument>
                <argument>${benchmark.port}</argument>
              </arguments>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>Benchmark Netty Client</id>
      <activation>
        <property>
          <name>benchmark</name>
          <value>netty.client</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-server</argument>
                <argument>-verbose:gc</argument>
                <argument>-Xms1g</argument>
                <argument>-Xmx1g</argument>
                <argument>-XX:NewSize=512m</argument>
                <argument>-XX:MaxNewSize=512m</argument>
                <argument>-cp</argument>
                <classpath />
                <argument>-Dcom.datatorrent.netlet.benchmark.message.count=${benchmark.count}</argument>
                <argument>-Dcom.datatorrent.netlet.benchmark.message.size=${benchmark.size}</argument>
                <argument>com.datatorrent.netlet.benchmark.netty.BenchmarkTcpClient</argument>
                <argument>${benchmark.host}</argument>
                <argument>${benchmark.port}</argument>
              </arguments>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.5</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.5</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-all</artifactId>
      <version>5.0.0.Alpha2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-configuration</groupId>
      <artifactId>commons-configuration</artifactId>
      <version>1.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>3.5</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

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

</project>
