<?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.phenomecentral</groupId>
    <artifactId>phenomecentral-parent</artifactId>
    <version>1.0-milestone-1</version>
  </parent>
  <artifactId>phenomecentral-war</artifactId>
  <name>PhenomeCentral - War package</name>
  <packaging>war</packaging>
  <properties>
    <!-- By default we don't include Legacy modules and thus we don't need to exclude the non legacy JARs -->
    <xwiki.war.legacy.excludes />

    <!-- XWiki Enterprise Manager embeds XWiki Enterprise -->
    <xwiki.extension.features>org.xwiki.enterprise:xwiki-enterprise-web</xwiki.extension.features>

    <!-- The default UI associated to this WAR -->
    <xwiki.extension.distribution.ui>org.phenomecentral:phenomecentral-ui</xwiki.extension.distribution.ui>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>phenotips-war</artifactId>
      <version>${phenotips.version}</version>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>patient-data-sharing-receiver-api</artifactId>
      <version>${phenotips.version}</version>
    </dependency>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>patient-similarity-data-api</artifactId>
      <version>${patientNetwork.version}</version>
    </dependency>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>patient-similarity-data-impl</artifactId>
      <version>${patientNetwork.version}</version>
    </dependency>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>patient-network-access-rules</artifactId>
      <version>${patientNetwork.version}</version>
    </dependency>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>patient-similarity-search</artifactId>
      <version>${patientNetwork.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpcore</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpmime</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>patient-similarity-configuration</artifactId>
      <version>${patientNetwork.version}</version>
    </dependency>
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>anonymous-communication</artifactId>
      <version>${patientNetwork.version}</version>
    </dependency>
    <!-- Disabled since this module isn't ready yet.
    <dependency>
      <groupId>org.phenotips</groupId>
      <artifactId>medsavant-client-api</artifactId>
      <version>${phenotips.version}</version>
    </dependency>
    -->
  </dependencies>
  <build>
    <plugins>
      <!-- Inject XWiki's configuration (only xwiki.cfg, not hibernate.cfg.xml) -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>xwiki-configuration-resources</id>
          </execution>
          <execution>
            <id>xwiki-platform-tool-configuration-resources</id>
            <goals>
              <goal>process</goal>
            </goals>
            <configuration>
              <resourceBundles>
                <resourceBundle>org.xwiki.platform:xwiki-platform-tool-configuration-resources:${xwiki.version}</resourceBundle>
              </resourceBundles>
              <properties>
                <xwikiDbConnectionUrl>jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true;hsqldb.cache_size=50000;hsqldb.script_format=3;hsqldb.nio_max_size=512;hsqldb.lob_file_scale=16;hsqldb.default_table_type=cached;hsqldb.tx=mvcc</xwikiDbConnectionUrl>
                <xwikiDbConnectionUsername>sa</xwikiDbConnectionUsername>
                <xwikiDbConnectionPassword />
                <xwikiDbConnectionDriverClass>org.hsqldb.jdbcDriver</xwikiDbConnectionDriverClass>
                <xwikiDbDialect>org.hibernate.dialect.HSQLDialect</xwikiDbDialect>
                <xwikiDbHbmXwiki>xwiki.hbm.xml</xwikiDbHbmXwiki>
                <xwikiDbHbmFeeds>feeds.hbm.xml</xwikiDbHbmFeeds>
                <xwikiDbHbmCommonExtraMappings>activitystream.hbm.xml</xwikiDbHbmCommonExtraMappings>
                <xwikiCfgPlugins>\
  com.xpn.xwiki.monitor.api.MonitorPlugin,\
  com.xpn.xwiki.plugin.skinx.JsSkinExtensionPlugin,\
  com.xpn.xwiki.plugin.skinx.JsSkinFileExtensionPlugin,\
  com.xpn.xwiki.plugin.skinx.JsResourceSkinExtensionPlugin,\
  com.xpn.xwiki.plugin.skinx.CssSkinExtensionPlugin,\
  com.xpn.xwiki.plugin.skinx.CssSkinFileExtensionPlugin,\
  com.xpn.xwiki.plugin.skinx.CssResourceSkinExtensionPlugin,\
  com.xpn.xwiki.plugin.skinx.LinkExtensionPlugin,\
  com.xpn.xwiki.plugin.mail.MailPlugin,\
  com.xpn.xwiki.plugin.packaging.PackagePlugin,\
  com.xpn.xwiki.plugin.svg.SVGPlugin,\
  com.xpn.xwiki.plugin.fileupload.FileUploadPlugin,\
  com.xpn.xwiki.plugin.image.ImagePlugin,\
  com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin,\
  com.xpn.xwiki.plugin.lucene.LucenePlugin,\
  com.xpn.xwiki.plugin.diff.DiffPlugin,\
  com.xpn.xwiki.plugin.rightsmanager.RightsManagerPlugin,\
  com.xpn.xwiki.plugin.jodatime.JodaTimePlugin,\
  com.xpn.xwiki.plugin.scheduler.SchedulerPlugin,\
  com.xpn.xwiki.plugin.mailsender.MailSenderPlugin,\
  com.xpn.xwiki.plugin.activitystream.plugin.ActivityStreamPlugin, \
  com.xpn.xwiki.plugin.watchlist.WatchListPlugin, \
  com.xpn.xwiki.plugin.tag.TagPlugin</xwikiCfgPlugins>
                <xwikiCfgVirtual>0</xwikiCfgVirtual>
                <xwikiCfgVirtualUsepath>0</xwikiCfgVirtualUsepath>
                <xwikiCfgEditCommentMandatory>0</xwikiCfgEditCommentMandatory>
                <xwikiCfgDefaultSkin>colibri</xwikiCfgDefaultSkin>
                <xwikiCfgDefaultBaseSkin>colibri</xwikiCfgDefaultBaseSkin>
                <xwikiCfgEncoding>UTF-8</xwikiCfgEncoding>
                <xwikiCfgAdditionalProperties>
xwiki.plugin.watchlist.automaticwatch=none
xwiki.authentication.group.allgroupimplicit=1
xwiki.section.edit=0
xwiki.backlinks=0
xwiki.showviewaction=0
xwiki.defaultweb=data
xwiki.usedefaultweb=1
xwiki.usedefaultaction=0
xwiki.monitor=0
xwiki.authentication.loginpage=/bin/PhenomeCentral/login
xwiki.authentication.loginsubmitpage=/bin/loginsubmit/PhenomeCentral/login
xwiki.store.attachment.hint=file
xwiki.store.attachment.versioning.hint=file
xwiki.store.attachment.recyclebin.hint=file
                </xwikiCfgAdditionalProperties>
                <xwikiPropertiesEnvironmentPermanentDirectory>/var/lib/phenotips/</xwikiPropertiesEnvironmentPermanentDirectory>
                <xwikiPropertiesAdditionalProperties>
model.reference.default.space=data
extension.repositories=maven-xwiki:maven:http://nexus.xwiki.org/nexus/content/groups/public
extension.repositories=maven-phenotips:maven:http://nexus.cs.toronto.edu/nexus/content/repositories/releases/
extension.repositories=extensions.xwiki.org:xwiki:http://extensions.xwiki.org/xwiki/rest/
solr.type=remote
solr.remote.url=http://localhost:8080/solr/xwiki/
                </xwikiPropertiesAdditionalProperties>
              </properties>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <!-- Include License resources -->
            <resource>
              <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
              <targetPath>META-INF</targetPath>
            </resource>
            <resource>
              <directory>${project.build.directory}/maven-shared-archive-resources</directory>
              <targetPath>WEB-INF</targetPath>
              <includes>
                <include>xwiki.cfg</include>
                <include>xwiki.properties</include>
                <include>hibernate.cfg.xml</include>
              </includes>
            </resource>
          </webResources>
          <!-- - Exclude JCL and LOG4J since we want all logging to go through SLF4J. Note that we're excluding
                 log4j-<version>.jar but keeping log4j-over-slf4j-<version>.jar
               - Exclude legacy modules if the legacy profile is not enabled so that we don't have both aspectified JAR
                 and non aspectified ones
               - Exclude batik-js to prevent conflict with the patched version of Rhino used by yuicompressor used for
                 JSX. See http://jira.xwiki.org/jira/browse/XWIKI-6151 for more details.
               - Exclude JavaBeans Activation Framework (activation-*.jar) since it's included in Java SE 6.
          -->
          <packagingExcludes>
            WEB-INF/lib/patient-data-sharing-push-api-*.jar,
            WEB-INF/lib/aspectjrt-1.6.11.jar,
            WEB-INF/lib/batik-js-*.jar,
            WEB-INF/lib/commons-lang-2.5.jar,
            WEB-INF/lib/commons-logging-*.jar,
            WEB-INF/lib/guava-12.0.jar,
            WEB-INF/lib/jdom-1.0.jar,
            WEB-INF/lib/rome-0.9.jar,
            WEB-INF/lib/wstx-asl-3.2.7.jar
          </packagingExcludes>
        </configuration>
      </plugin>
      <!-- Ensure that some modules are not added as dependencies. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-banned-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <exclude>org.jmock:*</exclude>
                    <exclude>junit:*</exclude>
                    <exclude>javax.servlet:servlet-api:*:*:compile</exclude>
                  </excludes>
                  <includes>
                    <!-- Allow only JUnit and JMock with scope test because -->
                    <include>org.jmock:*:*:*:test</include>
                    <include>junit:*:*:*:test</include>
                  </includes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
