<?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>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>
  <groupId>org.grouplens.lenskit</groupId>
  <artifactId>lenskit</artifactId>
  <version>2.0.5</version>
  <packaging>pom</packaging>
  <name>LensKit</name>
  <description>Collaborative filtering toolkit from GroupLens Research</description>
  <url>${lenskit.web.url}</url>
  <organization>
    <name>GroupLens Research</name>
    <url>http://www.grouplens.org</url>
  </organization>
  <licenses>
    <license>
      <name>LGPLv2+</name>
      <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/grouplens/lenskit/issues</url>
  </issueManagement>
  <scm>
    <connection>scm:git:http://github.com/grouplens/lenskit.git</connection>
    <developerConnection>scm:git:git@github.com:grouplens/lenskit.git</developerConnection>
    <url>http://github.com/grouplens/lenskit</url>
    <tag>lenskit-2.0.5</tag>
  </scm>

  <properties>
    <copyrightHolder>Regents of the University of Minnesota</copyrightHolder>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <lenskit.web.url>http://lenskit.grouplens.org/maven-site/</lenskit.web.url>
    <lenskit.web.path>file:///web/research/lenskit.grouplens.org/maven-site/</lenskit.web.path>
    <mathjax.source>http://cdn.mathjax.org/mathjax/latest</mathjax.source>
    <javadoc.cite.database>${basedir}/etc/references.rdf</javadoc.cite.database>
    <groovy.version>2.1.5</groovy.version>
    <groovy.eclipse.version>2.7.0-01</groovy.eclipse.version>
    <groovy.eclipse.batch>2.1.5-03</groovy.eclipse.batch>
    <lenskit.clean.removeAll>false</lenskit.clean.removeAll>
  </properties>

  <distributionManagement>
    <site>
      <id>grouplens.org</id>
      <name>LensKit Website</name>
      <url>${lenskit.web.path}</url>
    </site>
  </distributionManagement>

  <modules>
    <module>lenskit-api</module>
    <module>lenskit-data-structures</module>
    <module>lenskit-core</module>
    <module>lenskit-groovy</module>
    <module>lenskit-eval</module>
    <module>lenskit-knn</module>
    <module>lenskit-svd</module>
    <module>lenskit-slopeone</module>
    <module>lenskit-archetype-simple-analysis</module>
    <module>lenskit-archetype-fancy-analysis</module>
    <module>lenskit-eval-maven-plugin</module>
    <module>lenskit-test</module>
    <module>lenskit-integration-tests</module>
    <module>lenskit-package</module>
  </modules>

  <repositories>
    <!-- The current trunk may depend on snapshots of dependencies, such as Grapht,
         that are published to the GroupLens development repository. -->
    <repository>
      <id>grouplens-devel</id>
      <url>http://dev.grouplens.org/maven</url>
      <layout>default</layout>
      <snapshots>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
      <releases><enabled>false</enabled></releases>
    </repository>
  </repositories>

  <pluginRepositories>
    <!-- The current trunk may depend on snapshots of dependencies, such as Grapht,
         that are published to the GroupLens development repository. -->
    <pluginRepository>
      <id>grouplens-devel</id>
      <url>http://dev.grouplens.org/maven</url>
      <layout>default</layout>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
      <releases><enabled>false</enabled></releases>
    </pluginRepository>
  </pluginRepositories>

  <dependencyManagement>
    <dependencies>
      <!-- logging -->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.0.13</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.5</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-nop</artifactId>
        <version>1.7.5</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>1.7.5</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.5</version>
      </dependency>

      <!-- metadata -->
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>2.0.1</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>annotations</artifactId>
        <version>2.0.1</version>
      </dependency>
      <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
      </dependency>

      <!-- collections & utilities -->
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>14.0.1</version>
      </dependency>
      <dependency>
        <groupId>it.unimi.dsi</groupId>
        <artifactId>fastutil</artifactId>
        <version>6.5.6</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
      </dependency>

      <!-- I/O support -->
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
      </dependency>

      <!-- Groovy & Ant -->
      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy</artifactId>
        <version>${groovy.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>${groovy.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.8.4</version>
      </dependency>

      <!-- Grapht -->
      <dependency>
        <groupId>org.grouplens.grapht</groupId>
        <artifactId>grapht</artifactId>
        <version>0.6.0</version>
      </dependency>

      <!-- test libraries -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.3</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
      </dependency>
      <dependency>
        <groupId>org.grouplens.lenskit</groupId>
        <artifactId>lenskit-test</artifactId>
        <version>${project.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <!-- Configure global dependencies -->
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
      <optional>true</optional>
      <scope>compile</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <!-- Configure the compiler -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
          <configuration>
            <source>1.6</source>
            <target>1.6</target>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <!-- Enable incremental compilation. Yes, that's what this does.
                 See MCOMPILER-209. -->
            <useIncrementalCompilation>false</useIncrementalCompilation>
            <compilerArgs>
              <compilerArg>-Xlint</compilerArg>
              <compilerArg>-Xlint:-processing</compilerArg>
            </compilerArgs>
            <fork>true</fork>
          </configuration>
        </plugin>

        <!--JavaDoc -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.9</version>
        </plugin>

        <!-- Testing and verification -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.14.1</version>
          <configuration>
            <properties>
              <property>
                <name>listener</name>
                <value>org.grouplens.lenskit.util.test.LoggingListener</value>
              </property>
            </properties>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.14.1</version>
          <configuration>
            <properties>
              <property>
                <name>listener</name>
                <value>org.grouplens.lenskit.util.test.LoggingListener</value>
              </property>
            </properties>
          </configuration>
        </plugin>

        <!-- Packaging and build assistance -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.4.2</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>1.7.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.2.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-archetype-plugin</artifactId>
          <version>2.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.4</version>
        </plugin>

        <!-- Site generation -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.3</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-ssh-external</artifactId>
              <version>2.2</version>
            </dependency>
            <dependency>
              <groupId>org.apache.velocity</groupId>
              <artifactId>velocity</artifactId>
              <version>1.6</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>

    </pluginManagement>

    <plugins>

      <plugin>
        <!-- LensKit requires Java 1.6 or better. -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <configuration>
          <rules>
            <requireJavaVersion>
              <version>[1.6.0,)</version>
            </requireJavaVersion>
          </rules>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <executions>
          <execution>
            <inherited>false</inherited>
            <goals><goal>attach-descriptor</goal></goals>
          </execution>
        </executions>
      </plugin>

      <!-- Format the licensing plugin -->
      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <version>1.9.0</version>
        <inherited>false</inherited>
        <configuration>
          <basedir>${basedir}</basedir>
          <header>${basedir}/etc/header.txt</header>
          <aggregate>true</aggregate>
          <strictCheck>true</strictCheck>
          <includes>
            <include>*/src/**/*.java</include>
            <include>*/src/**/*.groovy</include>
          </includes>
          <excludes>
            <exclude>lenskit-archetype*/src/**</exclude>
          </excludes>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
            <groovy>SLASHSTAR_STYLE</groovy>
          </mapping>
        </configuration>
        <executions>
        <execution>
          <id>check-headers</id>
          <inherited>false</inherited>
          <phase>validate</phase>
          <goals>
            <goal>check</goal>
          </goals>
        </execution>
        </executions>
      </plugin>

      <!-- Generate class lists. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-class-list</id>
            <phase>process-classes</phase>
            <goals><goal>javadoc</goal></goals>
            <configuration>
              <doclet>org.grouplens.javadoc.classlist.ClassListDoclet</doclet>
              <docletArtifact>
                <groupId>org.grouplens.common</groupId>
                <artifactId>common-javadoc</artifactId>
                <version>0.8</version>
              </docletArtifact>
              <useStandardDocletOptions>false</useStandardDocletOptions>
              <additionalparam>-outfile "${project.build.outputDirectory}/META-INF/classes.lst"</additionalparam>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.6</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>dependencies</report>
              <report>dependency-info</report>
              <report>dependency-convergence</report>
              <report>dependency-management</report>
              <report>plugins</report>
              <report>plugin-management</report>
              <report>summary</report>
            </reports>
          </reportSet>
          <reportSet>
            <id>parent-info</id>
            <inherited>false</inherited>
            <reports>
              <report>modules</report>
              <report>issue-tracking</report>
              <report>scm</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <quiet>true</quiet>

          <tags>
            <tag>
              <name>todo</name>
              <placement>a</placement>
              <head>To Do:</head>
            </tag>
            <tag>
              <name>review</name>
              <placement>a</placement>
              <head>Review:</head>
            </tag>
          </tags>

          <additionalJOption>
            "-J-Dgrouplens.javadoc.versioning.url=${lenskit.web.url}/versioning.html"
          </additionalJOption>

          <taglets>
            <taglet>
              <tagletClass>org.grouplens.javadoc.taglets.CompatTaglet</tagletClass>
              <tagletArtifact>
                <groupId>org.grouplens.common</groupId>
                <artifactId>common-javadoc</artifactId>
                <version>0.7</version>
              </tagletArtifact>
            </taglet>
            <taglet>
              <tagletClass>org.grouplens.javadoc.taglets.ExtraInlineTaglet</tagletClass>
            </taglet>
          </taglets>

          <footer><![CDATA[
                  <script type=\"text/javascript\" src=\"${mathjax.source}/MathJax.js?config=TeX-AMS-MML_HTMLorMML\"></script>
                  ]]></footer>
          <detectJavaApiLink>true</detectJavaApiLink>
          <detectJavaLinks>true</detectJavaLinks>
          <links>
            <link>http://fastutil.dsi.unimi.it/docs/</link>
            <link>http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/</link>
            <link>http://dev.grouplens.org/grapht/apidocs/</link>
          </links>
          <useStandardDocletOptions>true</useStandardDocletOptions>
        </configuration>

        <reportSets>
          <reportSet>
            <id>parent</id>
            <inherited>false</inherited>
            <reports>
              <report>aggregate</report>
            </reports>
            <configuration>
              <groups>
                <group>
                  <title>General API</title>
                  <packages>org.grouplens.lenskit</packages>
                </group>
                <group>
                  <title>Core API</title>
                  <packages>org.grouplens.lenskit.core:org.grouplens.lenskit.params</packages>
                </group>
                <group>
                  <title>Data Structures</title>
                  <packages>org.grouplens.lenskit.vectors:org.grouplens.lenskit.collections:org.grouplens.lenskit.symbols</packages>
                </group>
                <group>
                  <title>Data Access</title>
                  <packages>org.grouplens.lenskit.data*:org.grouplens.lenskit.cursors</packages>
                </group>
                <group>
                  <title>Data Transformation</title>
                  <packages>org.grouplens.lenskit.baseline*:org.grouplens.lenskit.transform*:org.grouplens.lenskit.vectors.*</packages>
                </group>
                <group>
                  <title>Recommender Implementations</title>
                  <packages>org.grouplens.lenskit.knn*:org.grouplens.lenskit.mf*:org.grouplens.lenskit.slopeone*</packages>
                </group>
                <group>
                  <title>Recommender Evaluation</title>
                  <packages>org.grouplens.lenskit.eval*</packages>
                </group>
                <group>
                  <title>Utility Classes</title>
                  <packages>org.grouplens.lenskit.util*:org.grouplens.lenskit.test*</packages>
                </group>
              </groups>
            </configuration>
          </reportSet>
          <reportSet>
            <id>child</id>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>default-single</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <tarLongFileMode>gnu</tarLongFileMode>
                  <descriptors>
                    <descriptor>src/assemble/source-package.xml</descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>copy-downlaods</id>
                <phase>site</phase>
                <goals><goal>run</goal></goals>
                <configuration>
                  <target>
                    <copy todir="${project.build.directory}/site/downloads">
                      <fileset dir="${basedir}/lenskit-package/target">
                        <include name="lenskit-${project.version}.zip" />
                        <include name="lenskit-${project.version}.tar.gz" />
                      </fileset>
                    </copy>
                    <copy todir="${project.build.directory}/site/downloads">
                      <fileset dir="${project.build.directory}">
                        <include name="lenskit-${project.version}-source.zip" />
                        <include name="lenskit-${project.version}-source.tar.gz" />
                      </fileset>
                    </copy>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>lint</id>
      <activation>
        <property>
          <name>env.CI</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <grouplens.mldata.acknowledge>yes</grouplens.mldata.acknowledge>
      </properties>
      <pluginRepositories>
        <pluginRepository>
          <id>sonatype-snapshots</id>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
          <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>

    <profile>
      <id>external-build-dir</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>external.build.root</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>net.elehack.maven.plugins</groupId>
            <artifactId>external-build-maven-plugin</artifactId>
            <version>0.1</version>
            <configuration>
              <buildDirectory>${external.build.root}/${project.groupId}:${project.artifactId}</buildDirectory>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>setup-build-dir</goal>
                  <goal>teardown-build-dir</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
