<?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>
  <parent>
    <groupId>org.phenotips</groupId>
    <artifactId>phenotips-testing-framework</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <artifactId>phenotips-packager-maven-plugin</artifactId>
  <name>PhenoTips - Tools - Packager Maven Plugin</name>
  <packaging>maven-plugin</packaging>
  <description>A Maven plugin that packages a minimal PhenoTips distribution, containing Jetty and the base PhenoTips war, along with the specific dependencies needed for testing a module.</description>
  <properties>
    <mavenVersion>3.2.2</mavenVersion>
    <!-- Writing Maven plugins requires a lot of dependencies, disable ClassFanOutComplexity checks -->
    <checkstyle.suppressions.location>${basedir}/src/checkstyle/checkstyle-suppressions.xml</checkstyle.suppressions.location>
  </properties>
  <dependencies>
    <!-- Maven -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.velocity</groupId>
      <artifactId>velocity</artifactId>
      <version>1.7</version>
    </dependency>
    <!-- Plexus -->
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-archiver</artifactId>
      <version>2.4.4</version>
      <exclusions>
        <!-- We draw version 1.0-alpha-9-stable-1 but org.xwiki.commons:xwiki-commons-tool-xar-plugin draws
             org.codehaus.plexus:plexus-container-default:1.5.5 -->
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-container-default</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- XWiki dependencies, used at runtime by the import mojo -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-oldcore</artifactId>
      <version>${xwiki.version}</version>
      <exclusions>
        <!-- Exclude LOG4J and commons-logging so that we use SLF4J's bridges instead -->
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
        <!-- Exclude Servlet Environment since we want to run our code in a Standard Environment -->
        <exclusion>
          <groupId>org.xwiki.commons</groupId>
          <artifactId>xwiki-commons-environment-servlet</artifactId>
        </exclusion>
        <!-- Exclude org.apache.maven:maven-model:3.1.0 which is drawn from
             org.xwiki.commons:xwiki-commons-extension-api. Ideally we would upgrade to Maven 3.1.0 but this would
             mean that Maven 3.0.x couldn't be used anymore to build XWiki so FTM we continue basing this plugin code
             on Maven 3.0.x -->
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-model</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- Components Modules -->
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-component-default</artifactId>
      <version>${xwiki.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-environment-standard</artifactId>
      <version>${xwiki.version}</version>
    </dependency>
    <!-- ClassLoader -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-classloader-xwiki</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- URL -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-url-standard</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- Logging Dependencies. Ensures all logging goes through SLF4J and Logback. -->
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-logging-logback</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-logging-script</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <version>${slf4j.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>log4j-over-slf4j</artifactId>
      <version>${slf4j.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- Database engine -->
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>2.3.2</version>
      <scope>runtime</scope>
    </dependency>
    <!-- Needed at runtime -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-security-bridge</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-configuration-default</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-wiki-default</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- Make sure to include the proper version of antlr for hibernate-core -->
    <dependency>
      <groupId>antlr</groupId>
      <artifactId>antlr</artifactId>
      <version>2.7.6</version>
      <scope>runtime</scope>
    </dependency>
    <!-- We need the Servlet API dep since it's used by the Packager and since it has
         a provided scope in XWiki core it's not inherited as part of transitive deps -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-tool-configuration-resources</artifactId>
      <version>${xwiki.version}</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <!-- This to allow calling mvn phenotips-packager:<mojo> from the command line. For example mvn phenotips-packager:package
               Without this users would need to call mvn phenotips-packager-maven-plugin:package -->
          <goalPrefix>phenotips-packager</goalPrefix>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
