<?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>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>org.bdgenomics.cannoli</groupId>
  <artifactId>cannoli-parent_2.11</artifactId>
  <version>0.1.0</version>
  <packaging>pom</packaging>
  <name>Cannoli_${scala.version.prefix}</name>
  <description>Big Data Genomics ADAM Pipe API wrappers for bioinformatics tools.</description>
  <url>https://github.com/bigdatagenomics/cannoli</url>
  <inceptionYear>2017</inceptionYear>

  <properties>
    <adam.version>0.23.0</adam.version>
    <scala.version>2.11.8</scala.version>
    <scala.version.prefix>2.11</scala.version.prefix>
    <spark.version>1.6.3</spark.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.targetEncoding>UTF-8</project.build.targetEncoding>
    <maven.enforcer.maven-version>[3.1.1,)</maven.enforcer.maven-version>
    <maven.enforcer.jdk-version>[1.8,)</maven.enforcer.jdk-version>
    <maven.compile.source>1.8</maven.compile.source>
    <maven.compile.target>1.8</maven.compile.target>
    <scoverage.plugin.version>1.1.1</scoverage.plugin.version>
    <utils.version>0.2.13</utils.version>
  </properties>

  <modules>
    <module>core</module>
    <module>cli</module>
    <module>assembly</module>
  </modules>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://github.com/bigdatagenomics/cannoli/master/LICENSE.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:https://github.com/bigdatagenomics/cannoli</connection>
    <developerConnection>scm:git:https://github.com/bigdatagenomics/cannoli</developerConnection>
    <url>https://github.com/bigdatagenomics/cannoli.git</url>
    <tag>cannoli-parent_2.11-0.1.0</tag>
  </scm>
  <developers>
    <developer>
      <id>fnothaft</id>
      <name>Frank Austin Nothaft</name>
      <email>fnothaft@berkeley.edu</email>
      <url>http://www.fnothaft.net</url>
      <organization>U.C. Berkeley, Department of Electrical Engineering and  Computer Science</organization>
      <organizationUrl>http://www.cs.berkeley.edu/</organizationUrl>
    </developer>
    <developer>
      <id>heuermh</id>
      <name>Michael Heuer</name>
    </developer>
  </developers>
  <issueManagement>
    <system>github</system>
    <url>https://github.com/bigdatagenomics/cannoli/issues</url>
  </issueManagement>

  <build>
    <outputDirectory>target/scala-${scala.version}/classes</outputDirectory>
    <testOutputDirectory>target/scala-${scala.version}/test-classes</testOutputDirectory>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>net.alchim31.maven</groupId>
          <artifactId>scala-maven-plugin</artifactId>
          <version>3.2.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.5.1</version>
          <configuration>
            <source>${maven.compile.source}</source>
            <target>${maven.compile.target}</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.4.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.5.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>clirr-maven-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        <plugin>
          <groupId>org.scalariform</groupId>
          <artifactId>scalariform-maven-plugin</artifactId>
          <version>0.1.4</version>
        </plugin>
        <plugin>
          <groupId>org.scalatest</groupId>
          <artifactId>scalatest-maven-plugin</artifactId>
          <version>1.0</version>
        </plugin>
        <plugin>
          <groupId>com.mycila.maven-license-plugin</groupId>
          <artifactId>maven-license-plugin</artifactId>
          <version>1.10.b1</version>
        </plugin>
        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>2.2.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.12</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>templating-maven-plugin</artifactId>
          <version>1.0.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <configuration>
          <header>LICENSE_header.txt</header>
          <strictCheck>true</strictCheck>
          <properties>
            <owner>Big Data Genomics Developers</owner>
            <email>adam-developers@googlegroups.com</email>
          </properties>
          <includes>
            <include>src/main/scala/**</include>
            <include>src/test/scala/**</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>scala-compile-first</id>
            <phase>process-resources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>scala-test-compile-first</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
          <execution>
            <id>attach-scaladocs</id>
            <phase>verify</phase>
            <goals>
              <goal>doc-jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
          <useZincServer>true</useZincServer>
          <args>
            <arg>-unchecked</arg>
            <arg>-optimise</arg>
            <arg>-deprecation</arg>
          </args>
          <jvmArgs>
            <jvmArg>-Xms1024m</jvmArg>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
          <javacArgs>
            <javacArg>-source</javacArg>
            <javacArg>${maven.compile.source}</javacArg>
            <javacArg>-target</javacArg>
            <javacArg>${maven.compile.target}</javacArg>
          </javacArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>${maven.enforcer.maven-version}</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>${maven.enforcer.jdk-version}</version>
                </requireJavaVersion>
              </rules>    
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skipTests>true</skipTests>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.scalariform</groupId>
        <artifactId>scalariform-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>default-cli</id>
            <goals>
              <goal>format</goal>
            </goals>
            <configuration>
              <alignParameters>true</alignParameters>
              <alignSingleLineCaseStatements>true</alignSingleLineCaseStatements>
              <doubleIndentClassDeclaration>true</doubleIndentClassDeclaration>
              <preserveDanglingCloseParenthesis>true</preserveDanglingCloseParenthesis>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/scala</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/scala</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.bdgenomics.adam</groupId>
        <artifactId>adam-core_${scala.version.prefix}</artifactId>
        <version>${adam.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bdgenomics.adam</groupId>
        <artifactId>adam-cli_${scala.version.prefix}</artifactId>
        <version>${adam.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bdgenomics.cannoli</groupId>
        <artifactId>cannoli-core_${scala.version.prefix}</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bdgenomics.cannoli</groupId>
        <artifactId>cannoli-cli_${scala.version.prefix}</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bdgenomics.utils</groupId>
        <artifactId>utils-misc_${scala.version.prefix}</artifactId>
        <version>${utils.version}</version>
        <type>test-jar</type>
      </dependency>
      <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-core_${scala.version.prefix}</artifactId>
        <version>${spark.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-mapreduce</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-sql_${scala.version.prefix}</artifactId>
        <version>${spark.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_${scala.version.prefix}</artifactId>
        <version>2.2.6</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.scoverage</groupId>
            <artifactId>scoverage-maven-plugin</artifactId>
            <version>${scoverage.plugin.version}</version>
            <configuration>
              <scalaVersion>${scala.version}</scalaVersion>
              <aggregate>true</aggregate>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>coveralls</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <version>4.3.0</version>
            <configuration>
              <coberturaReports>
                <param>${project.build.directory}/cobertura.xml</param>
              </coberturaReports>
              <failOnServiceError>false</failOnServiceError>
              <sourceDirectories>
                <param>core/src/main/scala</param>
                <param>cli/src/main/scala</param>
              </sourceDirectories>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>distribution</id>
      <modules>
        <module>core</module>
        <module>cli</module>
        <module>assembly</module>
        <!-- distribution should be last -->
        <module>distribution</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>package</phase>
                <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.4</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>scala-compile-first</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <args>
                    <arg>-g:vars</arg>
                  </args>
                </configuration>
              </execution>
              <execution>
                <id>scala-test-compile-first</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>testCompile</goal>
                </goals>
              </execution>
              <execution>
                <id>attach-scaladocs</id>
                <phase>package</phase>
                <goals>
                  <goal>doc-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.0</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.4</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.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
