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

  <groupId>io.scalecube</groupId>
  <artifactId>scalecube-cluster-parent</artifactId>
  <version>2.0.0</version>
  <packaging>pom</packaging>

  <name>ScaleCube</name>
  <description>
        ScaleCube is a lightweight decentralized cluster membership, failure detection, messaging and
        gossip protocol library for the Java VM. 
  </description>
  <inceptionYear>2015</inceptionYear>
  <url>http://scalecube.io</url>

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

  <prerequisites>
    <maven>3.0.3</maven>
  </prerequisites>

  <scm>
    <url>https://github.com/scalecube/scalecube-cluster</url>
    <connection>scm:git:git@github.com:scalecube/scalecube-cluster.git</connection>
    <developerConnection>scm:git:git@github.com:scalecube/scalecube-cluster.git
        </developerConnection>
    <tag>v2.0.0</tag>
  </scm>

  <developers>
    <developer>
      <id>scalecube.io</id>
      <name>The ScaleCube Project Contributors</name>
      <email>info@scalecube.io</email>
      <organization>The ScaleCube Project</organization>
      <organizationUrl>http://scalecube.io/</organizationUrl>
    </developer>
  </developers>

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

  <properties>
    <argLine>-Xms1024m -Xmx2048m</argLine>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <slf4j.version>1.7.7</slf4j.version>
    <netty.version>4.1.25.Final</netty.version>
    <reactor.version>3.1.8.RELEASE</reactor.version>
    <socketio.version>2.3.0</socketio.version>
    <protostuff.version>1.6.0</protostuff.version>
    <protobuf.version>3.4.0</protobuf.version>
    <metrics.version>3.1.2</metrics.version>
    <jackson.version>2.9.5</jackson.version>

    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
    <skipStressTests>true</skipStressTests>
  </properties>

  <modules>
    <module>transport</module>
    <module>cluster</module>
    <module>testlib</module>
    <module>benchmark</module>
    <module>examples</module>
    <module>utils</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <!-- Slf4j -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <!-- Protostuff/Protobuf -->
      <dependency>
        <groupId>io.protostuff</groupId>
        <artifactId>protostuff-api</artifactId>
        <version>${protostuff.version}</version>
      </dependency>
      <dependency>
        <groupId>io.protostuff</groupId>
        <artifactId>protostuff-runtime</artifactId>
        <version>${protostuff.version}</version>
      </dependency>
      <dependency>
        <groupId>io.protostuff</groupId>
        <artifactId>protostuff-core</artifactId>
        <version>${protostuff.version}</version>
      </dependency>
      <dependency>
        <groupId>io.protostuff</groupId>
        <artifactId>protostuff-runtime-registry</artifactId>
        <version>${protostuff.version}</version>
      </dependency>
      <dependency>
        <groupId>io.protostuff</groupId>
        <artifactId>protostuff-collectionschema</artifactId>
        <version>${protostuff.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>

      <!-- https://mvnrepository.com/artifact/io.projectreactor/reactor-core -->
      <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-core</artifactId>
        <version>${reactor.version}</version>
      </dependency>


      <!-- Netty -->
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-buffer</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-codec</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-codec-http</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-common</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-handler</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport-native-epoll</artifactId>
        <classifier>linux-x86_64</classifier>
        <version>${netty.version}</version>
      </dependency>

      <!-- Dropwizard -->
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>${metrics.version}</version>
      </dependency>

      <!-- Jackson -->
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <!-- Socketio -->
      <dependency>
        <groupId>io.scalecube</groupId>
        <artifactId>socketio</artifactId>
        <version>${socketio.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <goals>deploy</goals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.7</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-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <compilerArgs>
            <arg>-proc:none</arg>
            <arg>-Xlint:unchecked</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>verify</phase>
            <configuration>
              <configLocation>checkstyle.xml</configLocation>
              <encoding>UTF-8</encoding>
              <consoleOutput>true</consoleOutput>
              <violationSeverity>warning</violationSeverity>
              <failsOnError>true</failsOnError>
              <maxAllowedViolations>0</maxAllowedViolations>
              <suppressionsLocation>checkstyle-suppression.xml</suppressionsLocation>
              <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.7.201606060606</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>


  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <!-- XXX consider removing this: -->
                  <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
