<?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.1.2</version>
  <packaging>pom</packaging>

  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>

  <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.1.2</tag>
  </scm>

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

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

  <repositories>
    <repository>
      <id>phenotips-releases</id>
      <name>PhenoTips Releases repository</name>
      <url>https://nexus.phenotips.org/nexus/content/repositories/releases/</url>
      <releases>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
    <repository>
      <id>phenotips-snapshots</id>
      <name>PhenoTips Snapshots repository</name>
      <url>https://nexus.phenotips.org/nexus/content/repositories/snapshots/</url>
      <releases>
        <enabled>false</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
    <repository>
      <id>phenotips-externals</id>
      <name>PhenoTips external repositories mirror</name>
      <url>https://nexus.phenotips.org/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>phenotips-externals</id>
      <name>PhenoTips external repositories mirror</name>
      <url>https://nexus.phenotips.org/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>phenotips-external-snapshots</id>
      <name>PhenoTips external snapshot repositories mirror</name>
      <url>https://nexus.phenotips.org/nexus/content/groups/public-snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <phenotips.version>1.1.2</phenotips.version>
    <xwiki.version>5.4.7</xwiki.version>
    <slf4j.version>1.7.10</slf4j.version>
    <buildtools.version>1.0</buildtools.version>
    <testframework.version>1.0-milestone-3</testframework.version>
    <solr.version>4.10.4</solr.version>
    <enforcer.skip>false</enforcer.skip>
    <checkstyle.skip>false</checkstyle.skip>
    <clirr.skip>false</clirr.skip>
    <coverage.instructionRatio>1.00</coverage.instructionRatio>

    <!-- Functional test environment -->
    <xwiki.defaultSkin>PhenoTips.Skin</xwiki.defaultSkin>
    <it.pattern>.*</it.pattern>
    <it.patternMethod>.*</it.patternMethod>
    <it.server.directory>${project.build.directory}/package/</it.server.directory>
    <it.server.port>8080</it.server.port>
    <it.server.stopPort>8079</it.server.stopPort>
    <it.server.startCommand>sh start.sh ${it.server.port} ${it.server.stopPort}</it.server.startCommand>
    <it.server.stopCommand>sh stop.sh ${it.server.stopPort}</it.server.stopCommand>
    <it.server.baseURL>http://localhost</it.server.baseURL>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Apache Commons -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.3.2</version>
      </dependency>
      <!-- Everybody logs -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <!-- Logging framework -->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.1.2</version>
      </dependency>
      <!-- Most plugins depend on the servlet API -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <!-- It should always be provided, otherwise containers will complain about it. -->
        <scope>provided</scope>
      </dependency>
      <!-- JSON serialization and deserialization -->
      <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <classifier>jdk15</classifier>
        <version>2.4</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <!-- Force a specific version since older incompatible versions are pulled otherwise -->
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>13.0.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore-nio</artifactId>
        <version>4.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3.5</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.3.5</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpasyncclient</artifactId>
        <version>4.0.2</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>rome</groupId>
        <artifactId>rome</artifactId>
        <version>1.0</version>
        <exclusions>
          <exclusion>
            <!-- We're using the newer org.jdom:jdom -->
            <groupId>jdom</groupId>
            <artifactId>jdom</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.10</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
      </dependency>
      <dependency>
        <groupId>xalan</groupId>
        <artifactId>xalan</artifactId>
        <version>2.7.2</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <defaultGoal>install</defaultGoal>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>2.6</version>
      </extension>
      <!-- Needed to add support for the "functional-tests" packaging -->
      <extension>
        <groupId>org.phenotips</groupId>
        <artifactId>phenotips-functional-tests-lifecycle</artifactId>
        <version>${testframework.version}</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</groupId>
        <artifactId>license-maven-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://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html
          -->
          <ignored>
            <!-- Remove the following ignores after we release 1.1 -->

            <!-- Utility class that should never be instantiated -->
            <difference>
              <differenceType>7009</differenceType>
              <className>**/hpoa/annotation/PrettyPrint</className>
              <method>PrettyPrint()</method>
            </difference>
            <!-- Badly designed class that is not used directly -->
            <difference>
              <differenceType>7002</differenceType>
              <className>**/obo2solr/Main</className>
              <method>void failWithMessage(java.lang.String)</method>
            </difference>
            <!-- Cleaning up unused APIs -->
            <difference>
              <differenceType>8001</differenceType>
              <className>**/hpoa/utils/maps/*MapOperator</className>
            </difference>
            <!-- New method in interface to facilitate patient comparisons -->
            <difference>
              <differenceType>7012</differenceType>
              <className>**/data/permissions/Visibility</className>
              <method>int getPermissiveness()</method>
            </difference>
            <!-- New methods in interface for linking to the chart source -->
            <difference>
              <differenceType>7012</differenceType>
              <className>**/measurements/MeasurementsChartConfiguration</className>
              <method>java.lang.String getChartSource()</method>
            </difference>
            <difference>
              <differenceType>7012</differenceType>
              <className>**/ontology/OntologyTerm</className>
              <method>net.sf.json.JSON toJson()</method>
            </difference>
            <difference>
              <differenceType>7012</differenceType>
              <className>**/ontology/OntologyService</className>
              <method>java.util.Set termSuggest(java.lang.String, java.lang.Integer, java.lang.String, java.lang.String)</method>
            </difference>
            <difference>
              <differenceType>7012</differenceType>
              <className>**/measurements/MeasurementsChartConfiguration</className>
              <method>java.net.URL getChartSourceLink()</method>
            </difference>
            <!-- Moved to the .script subpackage -->
            <difference>
              <differenceType>8001</differenceType>
              <className>**/measurements/MeasurementsScriptService</className>
            </difference>
            <difference>
              <className>org/phenotips/diagnosis/DiagnosisService</className>
              <differenceType>7004</differenceType>
              <method>java.util.List getDiagnosis(java.util.List, int)</method>
              <justification>The API should accept both ontology terms and non-standard features.</justification>
            </difference>
            <difference>
              <className>org/phenotips/diagnosis/script/DiagnosisScriptService</className>
              <differenceType>7004</differenceType>
              <method>java.util.List get(java.util.List, int)</method>
              <justification>The script service passes both ontology terms and non-standard features to the API.</justification>
            </difference>
          </ignored>
          <excludes>
            <exclude>**/internal/**</exclude>
            <exclude>**/test/**</exclude>
            <!-- Remove the following excludes after we release the current version as final -->
            <!-- Poor choice of visibility -->
            <exclude>**/phenotips/hpoa/PhenotypeMappingScriptService</exclude>
            <exclude>**/phenotips/measurements/MeasurementHandler</exclude>
          </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>license-resources</id>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <resourceBundles>
                <resourceBundle>org.phenotips:phenotips-license-resources:${buildtools.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.7.2.201409121644</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>
        <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>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.3.1</version>
        </plugin>
        <!-- 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.13</version>
          <dependencies>
            <dependency>
              <groupId>org.phenotips</groupId>
              <artifactId>phenotips-checkstyle-configuration</artifactId>
              <version>${buildtools.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <consoleOutput>true</consoleOutput>
            <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</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.6</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>
              <!-- Exclude sample patient records -->
              <exclude>**/P0*.xml</exclude>
              <exclude>**/F0*.xml</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.phenotips</groupId>
              <artifactId>phenotips-license-verification-resources</artifactId>
              <version>${buildtools.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.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5.1</version>
          <configuration>
            <arguments>-Pquick</arguments>
            <!-- 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>
            <tagNameFormat>phenotips-@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.6.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.2</version>
          <!-- Java 1.7 is required -->
          <configuration>
            <source>1.7</source>
            <target>1.7</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.18.1</version>
          <!-- Rule is to put tests in *Test classes -->
          <configuration>
            <includes>
              <include>**/*Test.class</include>
            </includes>
            <parallel>classesAndMethods</parallel>
            <threadCount>2</threadCount>
            <systemProperties>
              <property>
                <name>pattern</name>
                <value>${it.pattern}</value>
              </property>
              <property>
                <name>patternMethod</name>
                <value>${it.patternMethod}</value>
              </property>
              <property>
                <name>xwiki.test.baseURL</name>
                <value>${it.server.baseURL}</value>
              </property>
              <property>
                <name>xwiki.test.skipStart</name>
                <value>${it.skipStart}</value>
              </property>
              <property>
                <name>xwikiPort</name>
                <value>${it.server.port}</value>
              </property>
              <property>
                <name>xwikiStopPort</name>
                <value>${it.server.stopPort}</value>
              </property>
              <property>
                <name>xwikiExecutionDirectory</name>
                <value>${it.server.directory}</value>
              </property>
              <property>
                <name>screenshotDirectory</name>
                <value>${basedir}/target/screenshots</value>
              </property>
              <property>
                <name>xwikiExecutionStartCommand</name>
                <value>${it.server.startCommand}</value>
              </property>
              <property>
                <name>xwikiExecutionStopCommand</name>
                <value>${it.server.stopCommand}</value>
              </property>
              <property>
                <name>xwikiWebappName</name>
                <value>phenotips</value>
              </property>
              <property>
                <name>xwikiWebappPath</name>
                <value />
              </property>
            </systemProperties>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5</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.5.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.9</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.6</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.8.2</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.6</version>
            </dependency>
          </dependencies>
          <!-- This doesn't currently work on Jenkins...
          <configuration>
            <deployAtEnd>true</deployAtEnd>
          </configuration>
          -->
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.8</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>clirr-maven-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.6.1</version>
          <executions>
            <execution>
              <id>clirr-check</id>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <comparisonVersion>${clirr.previous.version}</comparisonVersion>
            <skip>${clirr.skip}</skip>
            <!-- The list of excluded files and ignored changes is configured way above, in the <plugins> section. -->
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.10.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.4</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.6</version>
            </dependency>
          </dependencies>
          <configuration>
            <reportPlugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</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.9.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>
                <!-- 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>
        <plugin>
          <groupId>org.phenotips</groupId>
          <artifactId>phenotips-packager-maven-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>${testframework.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <!-- Use this ( mvn install -Pquick ) when trying to get a quicker test build, without running any quality control checks. -->
      <id>quick</id>
      <properties>
        <enforcer.skip>true</enforcer.skip>
        <checkstyle.skip>true</checkstyle.skip>
        <clirr.skip>true</clirr.skip>
        <jacoco.skip>true</jacoco.skip>
        <skipTests>true</skipTests>
        <license.skip>true</license.skip>
        <xar.verify.skip>true</xar.verify.skip>
      </properties>
    </profile>

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

    <profile>
      <id>mac</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <os>
          <family>mac</family>
          <name>mac os x</name>
        </os>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>exec-maven-plugin</artifactId>
              <!-- Lock down plugin version for build reproducibility -->
              <version>1.3.2</version>
            </plugin>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>build-helper-maven-plugin</artifactId>
              <!-- Lock down plugin version for build reproducibility -->
              <version>1.9.1</version>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <!-- Test profiles -->
    <profile>
      <id>windows</id>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <properties>
        <it.server.startCommand>cmd /c start.bat ${it.server.port} ${it.server.stopPort}</it.server.startCommand>
        <it.server.stopCommand>cmd /c stop.bat ${it.server.stopPort}</it.server.stopCommand>
      </properties>
    </profile>
  </profiles>

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