<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>in.ashwanthkumar</groupId>
    <artifactId>suuchi</artifactId>
    <version>0.2.17</version>
    <name>Suuchi</name>
    <description>Toolkit to build distributed Data Systems</description>
    <packaging>pom</packaging>

    <modules>
        <module>suuchi-core</module>
        <module>suuchi-examples</module>
        <module>suuchi-rocksdb</module>
        <module>suuchi-cluster-scalecube</module>
    </modules>

    <url>https://github.com/ashwanthkumar/suuchi</url>
    <licenses>
        <license>
            <name>Apache2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/ashwanthkumar/suuchi</url>
        <connection>scm:git:git@github.com:ashwanthkumar/suuchi.git</connection>
      <tag>suuchi-0.2.17</tag>
  </scm>

    <developers>
        <developer>
            <email>ashwanthkumar@googlemail.com</email>
            <name>Ashwanth Kumar</name>
            <url>https://ashwanthkumar.in/</url>
            <id>ashwanthkumar</id>
        </developer>
        <developer>
            <email>sri.rams85@gmail.com</email>
            <name>Sriram Ramachandrasekaran</name>
            <id>brewkode</id>
        </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>
        <scala.version>2.11.8</scala.version>
        <scala.lib.version>2.11</scala.lib.version>
        <grpc.version>1.0.1</grpc.version>
        <jacoco-maven-plugin.version>0.7.7.201606060606</jacoco-maven-plugin.version>
    </properties>

    <dependencies>
        <!-- Adding this else coverage plugin's check fail because of absence of ScalaTestRunner -->
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.lib.version}</artifactId>
            <version>3.0.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.2</version>
                <executions>
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <recompileMode>incremental</recompileMode>
                            <compileOrder>Mixed</compileOrder>
                            <addScalacArgs>-feature</addScalacArgs>
                            <scalaVersion>${scala.version}</scalaVersion>
                            <javacArgs>
                                <javacArg>-source</javacArg>
                                <javacArg>1.7</javacArg>
                            </javacArgs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>scala-test-compile</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <recompileMode>incremental</recompileMode>
                            <compileOrder>Mixed</compileOrder>
                            <scalaVersion>${scala.version}</scalaVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>doc-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


            <!-- disable surefire -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>

            <!-- ScalaTest -->
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>WDF TestSuite.txt</filereports>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <useReleaseProfile>true</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <remoteTagging>true</remoteTagging>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <!-- turn off the site deploy. There's a maven bug that makes it break -->
                    <goals>deploy</goals>
                    <pushChanges>true</pushChanges>
                    <localCheckout>true</localCheckout>
                    <!--
                      During release:perform, enable the "release" profile
                    -->
                    <releaseProfiles>release-sign-artifacts</releaseProfiles>
                </configuration>
            </plugin>

            <!-- Codecoverage -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>post-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>in/ashwanthkumar/suuchi/rpc/generated/*</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <!-- only run the signing steps when actually deploying to Central -->
    <!-- add -DperformRelease to the mvn deploy command -->
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.4</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>
    </profiles>

    <reporting>
        <!--
            https://github.com/jacoco/jacoco/blob/master/jacoco-maven-plugin.test/it/it-site/pom.xml
        -->
        <!--<excludeDefaults>true</excludeDefaults>-->
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

</project>
