<?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.archivesunleashed</groupId>
  <artifactId>aut</artifactId>
  <packaging>jar</packaging>
  <version>0.9.0</version>
  <name>Archives Unleashed Toolkit</name>
  <description>An open-source platform for managing and analyzing web archives</description>
  <url>http://archivesunleashed.io/</url>

  <organization>
    <name>The Archives Unleased Project</name>
    <url>http://archivesunleashed.org/</url>
  </organization>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<project_name>${project.artifactId}</project_name>
		<project_organization>The Archives Unleashed Project</project_organization>
    <scala.version>2.10.5</scala.version>
    <hadoop.version>2.6.0-cdh5.7.1</hadoop.version>
    <spark.version>1.6.0-cdh5.7.1</spark.version>
    <github.global.server>github</github.global.server>
    <checkstyle.plugin.version>2.15</checkstyle.plugin.version>
    <license.plugin.version>2.11</license.plugin.version>
    <download-maven-plugin.version>1.3.0</download-maven-plugin.version>
    <release.plugin.version>2.5.2</release.plugin.version>
    <scm-provider-gitexe.plugin.version>1.9.4</scm-provider-gitexe.plugin.version>
    <changelog.plugin.version>2.3</changelog.plugin.version>
    <github-site.plugin.version>0.12</github-site.plugin.version>
    <javadoc.plugin.version>2.10.3</javadoc.plugin.version>
    <gpg.plugin.version>1.6</gpg.plugin.version>
  </properties>

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

  <scm>
    <connection>scm:git:git@github.com:archivesunleashed/aut.git</connection>
    <developerConnection>scm:git:git@github.com:archivesunleashed/aut.git</developerConnection>
    <url>git@github.com:archivesunleashed/aut.git</url>
    <tag>aut-0.9.0</tag>
  </scm>

  <repositories>
    <repository>
      <id>maven</id>
      <url>http://repo.maven.apache.org/maven2/</url>
    </repository>
    <repository>
      <id>cloudera</id>
      <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
    </repository>
    <repository>
      <id>internetarchive</id>
      <name>Internet Archive Maven Repository</name>
      <url>http://builds.archive.org:8080/maven2</url>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/services/org.apache.lucene.codecs.Codec</resource>
                </transformer>
              </transformers>

              <!-- This fixes the issue "Invalid signature file digest for Manifest main attributes"
                   cf. http://zhentao-li.blogspot.com/2012/06/maven-shade-plugin-invalid-signature.html -->
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <!-- this will create both a normal thin jar and also a fatjar -->
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>fatjar</shadedClassifierName>
              <artifactSet>
                <excludes>
                  <exclude>org.apache.hadoop:*</exclude>
                  <exclude>org.apache.spark:*</exclude>
                </excludes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- for Scala -->
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>2.15.2</version>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>add-source</goal>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>scala-test-compile</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
          <sendJavaToScalac>true</sendJavaToScalac>
          <args>
            <arg>-target:jvm-1.7</arg>
            <arg>-g:vars</arg>
            <arg>-deprecation</arg>
            <arg>-dependencyfile</arg>
            <arg>${project.build.directory}/.scala_dependencies</arg>
          </args>
        </configuration>
      </plugin>
      <!-- for checkstyle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle.plugin.version}</version>
        <configuration>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <consoleOutput>true</consoleOutput>
          <logViolationsToConsole>true</logViolationsToConsole>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <violationSeverity>warning</violationSeverity>
          <suppressionsLocation>config/checkstyle/suppressions.xml</suppressionsLocation>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- for codecov.io -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <formats>
            <format>html</format>
            <format>xml</format>
          </formats>
          <check />
        </configuration>
      </plugin>
      <!-- for mycila -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license.plugin.version}</version>
        <configuration>
          <header>LICENSE_HEADER.txt</header>
          <mapping>
              <java>SLASHSTAR_STYLE</java>
          </mapping>
          <includes>
            <include>**/src/main/java/**</include>
            <include>**/src/test/java/**</include>
          </includes>
          <excludes>
            <exclude>target/**</exclude>
            <exclude>**/src/test/resources/**</exclude>
            <exclude>**/src/main/resources/**</exclude>
            <exclude>**/*.properties</exclude>
          </excludes>
          <properties>
            <name>${project.artifactId}</name>
            <holder>${project.organization.name}</holder>
          </properties>
          <encoding>UTF-8</encoding>
          <strictCheck>true</strictCheck>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
			<!-- So we can release aut -->
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>${release.plugin.version}</version>
        <configuration>
          <!-- see http://jira.codehaus.org/browse/MRELEASE-424 -->
          <mavenExecutorId>forked-path</mavenExecutorId>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <version>${scm-provider-gitexe.plugin.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <!-- GitHub Pages -->
      <plugin>
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
        <version>${github-site.plugin.version}</version>
        <configuration>
          <message>Creating site for ${project.artifactId}, ${project.version}</message>
          <path>${project.distributionManagement.site.url}</path>
          <merge>true</merge>
          <excludes>
            <exclude>xref-test/**</exclude>
            <exclude>testapidocs/**</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>github</id>
            <goals>
              <goal>site</goal>
            </goals>
            <phase>site-deploy</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${javadoc.plugin.version}</version>
        <configuration>
          <linksource>true</linksource>
          <quiet>true</quiet>
        </configuration>
        <executions>
          <execution>
            <id>verify-javadocs</id>
            <goals>
              <goal>jar</goal>
              <goal>test-jar</goal>
            </goals>
          </execution>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
              <goal>javadoc</goal>
            </goals>
            <phase>site</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-changelog-plugin</artifactId>
        <version>${changelog.plugin.version}</version>
      </plugin>
		</plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_2.10</artifactId>
      <version>2.2.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala.version}</version>
    </dependency>
    <dependency>
      <groupId>com.chuusai</groupId>
      <artifactId>shapeless_2.10.5</artifactId>
      <version>2.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_2.10</artifactId>
      <version>${spark.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-graphx_2.10</artifactId>
      <version>${spark.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>14.0.1</version>
      <!-- downgrade to fix http://stackoverflow.com/questions/36427291/illegalaccesserror-to-guavas-stopwatch-from-org-apache-hadoop-mapreduce-lib-inp -->
    </dependency>
    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
      <version>1.0.5</version>
    </dependency>
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <version>1.7.3</version>
    </dependency>
    <dependency>
      <groupId>org.netpreserve.openwayback</groupId>
      <artifactId>openwayback-core</artifactId>
      <version>2.0.0.BETA.2</version>
    </dependency>
    <dependency>
      <groupId>org.netpreserve.commons</groupId>
      <artifactId>webarchive-commons</artifactId>
      <version>1.1.4</version>
    </dependency>
    <dependency>
      <groupId>edu.stanford.nlp</groupId>
      <artifactId>stanford-corenlp</artifactId>
      <version>3.4.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.tika</groupId>
      <artifactId>tika-core</artifactId>
      <version>1.9</version>
    </dependency>
    <dependency>
      <groupId>org.apache.tika</groupId>
      <artifactId>tika-parsers</artifactId>
      <version>1.9</version>
    </dependency>
    <dependency>  <!-- needed for running boilerpipe, but will compile without -->
      <groupId>com.syncthemall</groupId>
      <artifactId>boilerpipe</artifactId>
      <version>1.2.2</version>
    </dependency>
    <dependency>  <!-- needed for running boilerpipe. -->
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
      <version>2.11.0</version>
    </dependency>
    <dependency>
      <groupId>tl.lin</groupId>
      <artifactId>lintools-datatypes</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>

  <developers>
    <developer>
      <name>Jimmy Lin</name>
      <id>lintool</id>
      <email>jimmylin at uwaterloo dot ca</email>
      <organization>University of Waterloo</organization>
      <url>https://cs.uwaterloo.ca/~jimmylin/</url>
      <timezone>-5</timezone>
    </developer>
    <developer>
      <name>Ian Milligan</name>
      <id>ianmilligan1</id>
      <email>i2millig at uwaterloo dot ca</email>
      <organization>University of Waterloo</organization>
      <url>http://ianmilligan.ca/</url>
      <timezone>-5</timezone>
    </developer>
    <developer>
      <name>Nick Ruest</name>
      <id>ruebot</id>
      <email>ruestn at yorku dot ca</email>
      <organization>York University</organization>
      <url>http://ruebot.net</url>
      <timezone>-5</timezone>
    </developer>
  </developers>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/archivesunleashed/aut/issues</url>
  </issueManagement>

  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
              <artifactId>maven-gpg-plugin</artifactId>
              <version>${gpg.plugin.version}</version>
              <executions>
                <execution>
                  <id>sign-artifacts</id>
                  <phase>verify</phase>
                  <goals>
                    <goal>sign</goal>
                  </goals>
                </execution>
              </executions>
              <configuration>
                <useAgent>true</useAgent>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <pluginRepositories>
    <pluginRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>

    <pluginRepository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/content/repositories/releases</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
	</pluginRepositories>

  <distributionManagement>
    <site>
      <id>gh-pages</id>
      <name>Deployment through GitHub's site deployment plugin</name>
      <url>site/${project.version}</url>
    </site>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Shapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
	</distributionManagement>

</project>
