<?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<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>org.phenotips</groupId>
  <artifactId>phenotips-parent</artifactId>
  <version>1.0-milestone-9</version>
  <packaging>pom</packaging>

  <name>PhenoTips - Parent POM</name>
  <description>PhenoTips is a software tool providing an easy-to-use Web interface and standardized database back-end for collecting clinical symptoms and physical findings observed in patients with genetic disorders.</description>
  <url>http://phenotips.org/</url>
  <inceptionYear>2011</inceptionYear>

  <licenses>
    <license>
      <name>LGPL 2.1</name>
      <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/phenotips/phenotips.git</connection>
    <developerConnection>scm:git:git@github.com:phenotips/phenotips.git</developerConnection>
    <url>https://github.com/phenotips/phenotips.git/tree/master/</url>
    <tag>phenotips-1.0-milestone-9</tag>
  </scm>

  <organization>
    <name>University of Toronto, Computational Biology Lab</name>
    <url>http://compbio.cs.toronto.edu/</url>
  </organization>

  <distributionManagement>
    <site>
      <id>nexus.cs.toronto.edu</id>
      <url>dav:http://nexus.cs.toronto.edu/nexus/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</url>
    </site>
    <repository>
      <id>nexus.cs.toronto.edu</id>
      <name>Maven2 Remote Repository for Releases</name>
      <url>http://nexus.cs.toronto.edu/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>nexus.cs.toronto.edu</id>
      <name>Maven2 Development Repository for Snapshots</name>
      <url>http://nexus.cs.toronto.edu/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>uoft-releases</id>
      <name>UofT Releases repository</name>
      <url>http://nexus.cs.toronto.edu/nexus/content/repositories/releases/</url>
      <releases>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
    <repository>
      <id>uoft-snapshots</id>
      <name>UofT Releases repository</name>
      <url>http://nexus.cs.toronto.edu/nexus/content/repositories/snapshots/</url>
      <releases>
        <enabled>false</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
      <snapshots>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
    <repository>
      <id>uoft-externals</id>
      <name>UofT external repositories mirror</name>
      <url>http://nexus.cs.toronto.edu/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>uoft-externals</id>
      <name>UofT external repositories mirror</name>
      <url>http://nexus.cs.toronto.edu/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <xwiki.version>5.2-milestone-2</xwiki.version>
    <slf4j.version>1.7.5</slf4j.version>
    <enforcer.skip>false</enforcer.skip>
    <checkstyle.skip>false</checkstyle.skip>
    <clirr.skip>false</clirr.skip>
    <coverage.instructionRatio>1.00</coverage.instructionRatio>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Apache Commons -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
      </dependency>
      <!-- Everybody logs -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <!-- Most plugins depend on the servlet API -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <!-- Note: The 2.4 version is not technically correct as 2.4 corresponds to a specification
             # and is not an implementation version. The central repo would need to be fixed... -->
        <version>2.4</version>
        <!-- It should always be provided, otherwise containers will complain about it. -->
        <scope>provided</scope>
      </dependency>
      <!-- External HTTP communication -->
      <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
      </dependency>
      <!-- JSON serialization and deserialization -->
      <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <classifier>jdk15</classifier>
        <version>2.4</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <defaultGoal>install</defaultGoal>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>2.2</version>
      </extension>
    </extensions>
    <plugins>
      <!-- Show compiler warnings -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgument>-Xlint:all</compilerArgument>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>

      <plugin>
        <!-- Run Checkstyle -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <!-- Check license headers -->
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
      </plugin>
      <plugin>
        <!-- API backwards compatibility check -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>clirr-maven-plugin</artifactId>
        <configuration>
          <!-- List of specific CLIRR excludes.
               See http://mojo.codehaus.org/clirr-maven-plugin/examples/ignored-differences.html
          -->
          <ignored>
            <!-- Remove the following ignores after we release 1.0-milestone-9 -->
            <difference>
              <className>**/similarity/PatientSimilarityView</className>
              <differenceType>7006</differenceType>
              <method>org.phenotips.data.similarity.AccessType getAccess()</method>
              <to>org.phenotips.data.permissions.AccessLevel</to>
            </difference>
            <difference>
              <className>**/ontology/*Service</className>
              <differenceType>7012</differenceType>
              <method>long size()</method>
            </difference>
            <difference>
              <className>**/ontology/OntologyService</className>
              <differenceType>7012</differenceType>
              <method>long count(java.util.Map)</method>
            </difference>
            <difference>
              <className>**/ontology/OntologyService</className>
              <differenceType>7012</differenceType>
              <method>long getDistance(java.lang.String, java.lang.String)</method>
            </difference>
            <difference>
              <className>**/ontology/OntologyService</className>
              <differenceType>7012</differenceType>
              <method>long getDistance(org.phenotips.ontology.OntologyTerm, org.phenotips.ontology.OntologyTerm)</method>
            </difference>
            <difference>
              <className>**/ontology/OntologyTerm</className>
              <differenceType>7012</differenceType>
              <method>long getDistanceTo(org.phenotips.ontology.OntologyTerm)</method>
            </difference>
          </ignored>
          <excludes>
            <exclude>**/internal/**</exclude>
            <exclude>**/test/**</exclude>
            <!-- Remove the following excludes after we release the current version as final -->
            <className>**/AccessType</className>
          </excludes>
        </configuration>
      </plugin>
      <!-- We want to force packaging the license resources in the produced XWiki artifacts -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>xwiki-license-resources</id>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <resourceBundles>
                <resourceBundle>org.xwiki.commons:xwiki-commons-tool-license-resources:${xwiki.version}</resourceBundle>
              </resourceBundles>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Fail the build if the test coverage is below a given value. -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.6.3.201306030806</version>
        <executions>
          <execution>
            <id>jacoco-prepare</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-check</id>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <rules>
            <rule>
              <limits>
                <limit>
                  <counter>INSTRUCTION</counter>
                  <minimum>${coverage.instructionRatio}</minimum>
                </limit>
              </limits>
            </rule>
          </rules>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <!-- Lock down plugin version for build reproducibility -->
        <version>1.1</version>
        <dependencies>
          <dependency>
            <groupId>org.xwiki.commons</groupId>
            <artifactId>xwiki-commons-tool-enforcer-dependencies</artifactId>
            <version>${xwiki.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <!-- Check that all Maven plugins have versions defined -->
          <execution>
            <id>enforce-plugins</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requirePluginVersions>
                  <message>Best Practice is to always define plugin versions!</message>
                  <banLatest>false</banLatest>
                  <banRelease>false</banRelease>
                  <banSnapshots>false</banSnapshots>
                </requirePluginVersions>
              </rules>
            </configuration>
          </execution>
          <!-- Check that we're using commons-lang3 and not commons-lang -->
          <execution>
            <id>enforce-commons-lang3</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <searchTransitive>false</searchTransitive>
                  <message>
                    Best practice is to use Commons Lang 3.x
                  </message>
                  <excludes>
                    <exclude>commons-lang:commons-lang</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-no-legacy-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <xwikiBannedDependencies implementation="org.xwiki.tool.enforcer.XWikiBannedDependencies">
                  <searchTransitive>true</searchTransitive>
                  <message>Don't depend on a XWiki Legacy module!</message>
                  <excludes>
                    <exclude>.*xwiki.*:.*-legacy-.*</exclude>
                  </excludes>
                </xwikiBannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <skip>${enforcer.skip}</skip>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!-- Apply checkstyle rules and fail the build in case of errors. The checkstyle config
             files are taken from the build-tools JAR module.-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.9.1</version>
          <dependencies>
            <dependency>
              <groupId>org.xwiki.commons</groupId>
              <artifactId>xwiki-commons-tool-verification-resources</artifactId>
              <version>${xwiki.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <consoleOutput>true</consoleOutput>
            <!-- We use this to disable checkstyle when the clover profile is executed since there's a
                 conflict between checkstyle and clover. Namely the clovered code doesn't pass our
                 checkstyle rules -->
            <skip>${checkstyle.skip}</skip>
            <configLocation>checkstyle.xml</configLocation>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <!-- Check license headers and fail the build if they're missing or not matching the defined format -->
        <plugin>
          <groupId>com.mycila.maven-license-plugin</groupId>
          <artifactId>maven-license-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.9.0</version>
          <configuration>
            <skip>${license.skip}</skip>
            <header>license.txt</header>
            <strictCheck>true</strictCheck>
            <headerDefinitions>
              <!-- Our style for XML headers isn't standard so we need to define it in a custom manner.
                   See xwiki-commons-tool-validation-resources module -->
              <headerDefinition>license-xml-definition.xml</headerDefinition>
              <headerDefinition>license-script-definition.xml</headerDefinition>
              <headerDefinition>license-batch-definition.xml</headerDefinition>
            </headerDefinitions>
            <!-- Our Java and XML styles aren't the default so we need to change the mapping -->
            <mapping>
              <java>SLASHSTAR_STYLE</java>
              <aj>SLASHSTAR_STYLE</aj>
            </mapping>
            <!-- We're only interested in checking our sources and our POMs -->
            <!-- At the moment, only check the license headers in Java, XML and shell script files -->
            <!-- FIXME: fix other types of files as well -->
            <includes>
              <include>src/**/*.java</include>
              <include>src/**/*.xml</include>
              <include>src/**/*.bat</include>
              <include>src/**/*.sh</include>
              <include>pom.xml</include>
            </includes>
            <excludes>
              <!-- At the moment we don't have a comment syntax for components.txt files so we need to exclude them
                   from the check -->
              <exclude>**/components.txt</exclude>
              <exclude>**/component-overrides.txt</exclude>
              <!-- Since there's no comment syntax for Maven IT tests's goal.txt file we need to exclude it -->
              <exclude>**/it/**/goals.txt</exclude>
              <exclude>**/goal.txt</exclude>
            </excludes>
            <useDefaultExcludes>false</useDefaultExcludes>
          </configuration>
          <!-- Add a dependency since this is where the maven-license-plugin plugin will find the license.txt file -->
          <dependencies>
            <dependency>
              <groupId>org.xwiki.commons</groupId>
              <artifactId>xwiki-commons-tool-verification-resources</artifactId>
              <version>${xwiki.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.3</version>
        </plugin>
        <plugin>
          <!-- Since 2.0-beta-9 maven-release-plugin uses remote tagging by default. Remote tagging implies that SCM
               information is not fetched from the local working copy but from the SCM pom configuration. This forces
               us to specify SCM configuration in every module which has its own lifecycle. Inheritance can't be used
               for SCM configuration since a released parent pom contains SCM information about its tag and not about
               the trunk. We could have globally set remoteTagging to false but we haven't since we prefer to follow
               maven conventions as much as possible. -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.4</version>
          <configuration>
            <!-- By default the release plugin will execute the "clean" and "verify" goals but won't perform an
                 "install". This is causing problems since several modules will fail to build during release:prepare.
                 See http://tinyurl.com/354vwe for more details. Thus we're forcing the execution of the "install"
                 goal. -->
            <preparationGoals>clean install</preparationGoals>
            <!-- Avoid site generation during the release:perform to speed up release process -->
            <goals>deploy</goals>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <localCheckout>true</localCheckout>
            <pushChanges>false</pushChanges>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.1.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.9</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5.1</version>
          <!-- We're using Java 1.6 is required -->
          <configuration>
            <source>1.6</source>
            <target>1.6</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.12.3</version>
          <!-- Rule is to put tests in *Test classes -->
          <configuration>
            <includes>
              <include>**/*Test.class</include>
            </includes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.4</version>
          <configuration>
            <!-- Add some useful information about the extension in the manifest file. -->
            <archive>
              <manifestEntries>
                <XWiki-Extension-Id>${project.groupId}:${project.artifactId}</XWiki-Extension-Id>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.2</version>
          <configuration>
            <!-- Add some useful information about the extension in the manifest file. -->
            <archive>
              <manifestEntries>
                <XWiki-Extension-Id>${project.groupId}:${project.artifactId}</XWiki-Extension-Id>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.7</version>
          <!-- We're deploying to Nexus using the WebDAV protocol -->
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav-jackrabbit</artifactId>
              <version>2.2</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>clirr-maven-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5</version>
          <executions>
            <execution>
              <id>clirr-check</id>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <comparisonVersion>${clirr.previous.version}</comparisonVersion>
            <skip>${clirr.skip}</skip>
            <excludes>
              <exclude>**/internal/**</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.8.1</version>
          <configuration>
            <!-- Always exclude the internal package since it's not user-public -->
            <excludePackageNames>*.internal.*</excludePackageNames>
            <!-- Make sure javadoc has enough memory -->
            <maxmemory>300m</maxmemory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.2</version>
          <!-- Site Plugin doesn’t automatically pull the Apache Wagon implementation -->
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav-jackrabbit</artifactId>
              <version>2.2</version>
            </dependency>
          </dependencies>
          <configuration>
            <reportPlugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                  <!-- Since contacting the Maven Repositories can take a very long time, tell the plugin not to display
                       the repository locations of the dependencies in the report. -->
                  <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
                <reports>
                  <report>summary</report>
                  <report>index</report>
                  <report>dependencies</report>
                  <report>dependency-convergence</report>
                  <report>mailing-list</report>
                  <report>issue-tracking</report>
                  <report>scm</report>
                </reports>
              </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                  <!-- Always exclude the internal package since it's not user-public -->
                  <excludePackageNames>*.internal.*</excludePackageNames>
                  <!-- Make sure javadoc has enough memory -->
                  <maxmemory>300m</maxmemory>
                </configuration>
                <!-- Don't generate test javadoc -->
                <reports>
                  <report>javadoc</report>
                </reports>
              </plugin>
            </reportPlugins>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.xwiki.commons</groupId>
          <artifactId>xwiki-commons-tool-xar-plugin</artifactId>
          <version>${xwiki.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <!-- Profile used when the release plugin executes. We want javadocs and source jars to be released
           + ensure we sign files using GPG. -->
      <id>release</id>
      <activation>
        <property>
          <!-- This property is automatically defined by the Maven release plugin when executing
               a release. Thus this profile will be automatically enabled when releasing -->
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <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>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <useAgent>true</useAgent>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <modules>
    <module>components</module>
    <module>resources</module>
    <module>pedigree</module>
    <module>distribution</module>
  </modules>
</project>
