<?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.xwiki.platform</groupId>
    <artifactId>xwiki-platform</artifactId>
    <version>10.8.1</version>
  </parent>
  <artifactId>xwiki-platform-distribution</artifactId>
  <name>XWiki Platform - Distribution - Parent POM</name>
  <packaging>pom</packaging>
  <description>Parent pom of the default XWiki distribution. Can also be used as parent for custom distributions.</description>
  <modules>
    <module>xwiki-platform-distribution-ui</module>
    <module>xwiki-platform-distribution-war-dependencies</module>
    <module>xwiki-platform-distribution-war-legacydependencies</module>
    <module>xwiki-platform-distribution-war</module>
    <module>xwiki-platform-distribution-jetty-hsqldb</module>
    <module>xwiki-platform-distribution-flavor</module>
    <module>xwiki-platform-distribution-debian</module>
    <module>xwiki-platform-distribution-fedora</module>
    <module>xwiki-platform-distribution-resources</module>
  </modules>
  <properties>
    <!-- Flavors known to be valid with the current distribution -->
    <!-- Using ${platform.version} on purpose here. An XWiki distribution with a different version might inherit this. -->
    <xwiki.extension.knownFlavors>
      org.xwiki.platform:xwiki-platform-distribution-flavor-mainwiki/${platform.version},
      org.xwiki.platform:xwiki-platform-distribution-flavor-wiki/${platform.version}
    </xwiki.extension.knownFlavors>

    <!-- Flavors known to be incompatible with the current distribution -->
    <xwiki.extension.knownInvalidFlavors>
      org.xwiki.enterprise:xwiki-enterprise-ui-mainwiki,
      org.xwiki.enterprise:xwiki-enterprise-ui-wiki,
      org.xwiki.platform:xwiki-platform-distribution-flavor,
      org.xwiki.manager:xwiki-manager-ui,
      org.xwiki.manager:xwiki-manager-wiki-administrator,
      org.xwiki.manager:xwiki-enterprise-manager-wiki-administrator,
      com.xpn.xwiki.products:xwiki-enterprise-manager-wiki-administrator,
      com.xpn.xwiki.products:xwiki-enterprise-wiki
    </xwiki.extension.knownInvalidFlavors>

    <!-- Hibernate configuration -->
    <xwiki.db.common.extraMappings>
      activitystream.hbm.xml,instance.hbm.xml,notification-filter-preferences.hbm.xml
    </xwiki.db.common.extraMappings>
    <xwiki.db.default.extraMappings>mailsender.hbm.xml</xwiki.db.default.extraMappings>
    <xwiki.db.oracle.extraMappings>mailsender.oracle.hbm.xml</xwiki.db.oracle.extraMappings>
    <xwiki.db.mysql.extraMappings>mailsender.hbm.xml</xwiki.db.mysql.extraMappings>
    <xwiki.db.hsqldb.extraMappings>mailsender.hbm.xml</xwiki.db.hsqldb.extraMappings>
    <xwiki.db.pgsql.extraMappings>mailsender.hbm.xml</xwiki.db.pgsql.extraMappings>
    <xwiki.db.derby.extraMappings>mailsender.hbm.xml</xwiki.db.derby.extraMappings>
    <xwiki.db.h2.extraMappings>mailsender.hbm.xml</xwiki.db.h2.extraMappings>

    <!-- Features -->
    <platform.distribution.features>xwiki</platform.distribution.features>

    <!-- xwiki.cfg configuration -->
    <!-- Default plugin list -->
    <platform.xwiki.cfg.plugins.default>\
  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.feed.FeedPlugin,\
  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.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.tag.TagPlugin,\
  com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin
    </platform.xwiki.cfg.plugins.default>
    <!-- Legacy plugin list -->
    <platform.xwiki.cfg.plugins.legacy>${platform.xwiki.cfg.plugins.default},\
  com.xpn.xwiki.plugin.watchlist.WatchListPlugin
    </platform.xwiki.cfg.plugins.legacy>
    <xwiki.cfg.plugins.default>${platform.xwiki.cfg.plugins.default}</xwiki.cfg.plugins.default>
    <xwiki.cfg.plugins.legacy>${platform.xwiki.cfg.plugins.legacy}</xwiki.cfg.plugins.legacy>
    <!-- Indicate the default list. -->
    <xwiki.cfg.plugins>${xwiki.cfg.plugins.default}</xwiki.cfg.plugins>

    <xwiki.cfg.defaultskin>flamingo</xwiki.cfg.defaultskin>
    <xwiki.cfg.defaultbaseskin>flamingo</xwiki.cfg.defaultbaseskin>
    <xwiki.cfg.encoding>UTF-8</xwiki.cfg.encoding>
    <xwiki.cfg.editcomment.mandatory>0</xwiki.cfg.editcomment.mandatory>
    <xwiki.cfg.additionalproperties />

    <xwiki.properties.environment.permanentDirectory />
    <xwiki.properties.extensions.oldflavors>
      <!-- Old extensions that we consider now as flavors -->
      org.xwiki.enterprise:xwiki-enterprise-ui-mainwiki,
      org.xwiki.enterprise:xwiki-enterprise-ui-wiki,
      org.xwiki.manager:xwiki-manager-ui,
      org.xwiki.manager:xwiki-manager-wiki-administrator,
      org.xwiki.manager:xwiki-enterprise-manager-wiki-administrator,
      com.xpn.xwiki.products:xwiki-enterprise-manager-wiki-administrator,
      com.xpn.xwiki.products:xwiki-enterprise-wiki
    </xwiki.properties.extensions.oldflavors>
    <xwiki.properties.defaultWysiwygEditor />
    <xwiki.properties.additionalproperties />

    <!-- Default location for XWiki's Data directory -->
    <xwikiDataDir>data</xwikiDataDir>

    <!-- Version of JDBC connectors we want to use in our distribution and when using build tools -->
    <hsqldb.groupId>org.hsqldb</hsqldb.groupId>
    <hsqldb.artifactId>hsqldb</hsqldb.artifactId>
    <mysql.version>5.1.45</mysql.version>
    <derby.version>10.14.1.0</derby.version>
    <pgsql.version>42.1.4</pgsql.version>

    <!-- Set HSQLDB by default -->
    <xwiki.db>hsqldb</xwiki.db>
    <xwiki.db.jdbc.groupId>${hsqldb.groupId}</xwiki.db.jdbc.groupId>
    <xwiki.db.jdbc.artifactId>${hsqldb.artifactId}</xwiki.db.jdbc.artifactId>
    <xwiki.db.jdbc.version>${hsqldb.version}</xwiki.db.jdbc.version>
    <xwiki.db.connection.url>jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</xwiki.db.connection.url>
    <xwiki.db.connection.username>sa</xwiki.db.connection.username>
    <xwiki.db.connection.password />
    <xwiki.db.connection.driver_class>org.hsqldb.jdbcDriver</xwiki.db.connection.driver_class>
    <xwiki.db.dialect>org.hibernate.dialect.HSQLDialect</xwiki.db.dialect>
    <xwiki.db.hbm.xwiki>xwiki.hbm.xml</xwiki.db.hbm.xwiki>
    <xwiki.db.hbm.feeds>feeds.hbm.xml</xwiki.db.hbm.feeds>

    <!-- The module triggering all WAR dependencies. Put in a property to be changed when legacy profile is enabled. -->
    <war.dependencies.artifactId>xwiki-platform-distribution-war-dependencies</war.dependencies.artifactId>
    <war.dependencies.artifactId.legacy>xwiki-platform-distribution-war-legacydependencies</war.dependencies.artifactId.legacy>

    <!-- The child modules don't provide APIs (those should be in xwiki-platform-core) so we don't need to check for
      backward compatibility breakages. -->
    <xwiki.revapi.skip>true</xwiki.revapi.skip>
    <!-- Don't cloverify distribution code since there should be no code and we don't want to include any test or
         tools used to build the distributions in the global TPC we computed. We want only runtime code -->
    <xwiki.clover.skip>true</xwiki.clover.skip>
  </properties>

  <!-- Avoid enforce-upper-bounds rule complains (they're actually false positives since Extension Manager is not
       affected by that) -->
  <dependencyManagement>
    <dependencies>
      <!-- application-help-center -->
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-icon-script</artifactId>
        <version>10.8.1</version>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-skin-skinx</artifactId>
        <version>10.8.1</version>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-rendering-wikimacro-store</artifactId>
        <version>10.8.1</version>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-administration-ui</artifactId>
        <version>10.8.1</version>
        <type>xar</type>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-extension-ui</artifactId>
        <version>10.8.1</version>
        <type>xar</type>
      </dependency>
      <dependency>
        <groupId>org.xwiki.rendering</groupId>
        <artifactId>xwiki-rendering-macro-toc</artifactId>
        <version>${rendering.version}</version>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-rendering-macro-gallery</artifactId>
        <version>10.8.1</version>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-chart-macro</artifactId>
        <version>10.8.1</version>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-index-tree-macro</artifactId>
        <version>10.8.1</version>
        <type>xar</type>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-index-ui</artifactId>
        <version>10.8.1</version>
        <type>xar</type>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-help-ui</artifactId>
        <version>10.8.1</version>
        <type>xar</type>
      </dependency>
      <dependency>
        <groupId>org.xwiki.rendering</groupId>
        <artifactId>xwiki-rendering-macro-velocity</artifactId>
        <version>${rendering.version}</version>
      </dependency>
      <!-- application-tour-ui -->
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-appwithinminutes-ui</artifactId>
        <version>10.8.1</version>
        <type>xar</type>
      </dependency>
      <dependency>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-security-script</artifactId>
        <version>10.8.1</version>
      </dependency>
      <!-- application-ckeditor-ui -->
      <dependency>
        <groupId>org.xwiki.rendering</groupId>
        <artifactId>xwiki-rendering-macro-html</artifactId>
        <version>${rendering.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <configuration>
            <appendAssemblyId>false</appendAssemblyId>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.xwiki.commons</groupId>
          <artifactId>xwiki-commons-tool-remote-resource-plugin</artifactId>
          <version>${commons.version}</version>
          <executions>
            <execution>
              <id>xwiki-platform-tool-configuration-resources</id>
              <phase>process-resources</phase>
              <goals>
                <goal>process</goal>
              </goals>
              <configuration>
                <resourceBundles>
                  <!-- Using ${platform.version} on purpose here. An XWiki distribution with a different version might inherit this. -->
                  <resourceBundle>org.xwiki.platform:xwiki-platform-tool-configuration-resources:${platform.version}</resourceBundle>
                </resourceBundles>
                <properties>
                  <xwikiDb>${xwiki.db}</xwikiDb>

                  <!-- Default configuration data for hibernate.cfg.xml -->
                  <xwikiDbConnectionUrl>${xwiki.db.connection.url}</xwikiDbConnectionUrl>
                  <xwikiDbConnectionUsername>${xwiki.db.connection.username}</xwikiDbConnectionUsername>
                  <xwikiDbConnectionPassword>${xwiki.db.connection.password}</xwikiDbConnectionPassword>
                  <xwikiDbConnectionDriverClass>${xwiki.db.connection.driver_class}</xwikiDbConnectionDriverClass>
                  <xwikiDbDialect>${xwiki.db.dialect}</xwikiDbDialect>
                  <xwikiDbHbmXwiki>${xwiki.db.hbm.xwiki}</xwikiDbHbmXwiki>
                  <xwikiDbHbmFeeds>${xwiki.db.hbm.feeds}</xwikiDbHbmFeeds>
                  <xwikiDbHbmCommonExtraMappings>${xwiki.db.common.extraMappings}</xwikiDbHbmCommonExtraMappings>
                  <xwikiDbHbmDefaultExtraMappings>${xwiki.db.default.extraMappings}</xwikiDbHbmDefaultExtraMappings>
                  <xwikiDbHbmHSQLDBExtraMappings>${xwiki.db.hsqldb.extraMappings}</xwikiDbHbmHSQLDBExtraMappings>
                  <xwikiDbHbmMySQLExtraMappings>${xwiki.db.mysql.extraMappings}</xwikiDbHbmMySQLExtraMappings>
                  <xwikiDbHbmPostgreSQLExtraMappings>${xwiki.db.pgsql.extraMappings}</xwikiDbHbmPostgreSQLExtraMappings>
                  <xwikiDbHbmOracleExtraMappings>${xwiki.db.oracle.extraMappings}</xwikiDbHbmOracleExtraMappings>
                  <xwikiDbHbmDerbyExtraMappings>${xwiki.db.derby.extraMappings}</xwikiDbHbmDerbyExtraMappings>
                  <xwikiDbHbmH2ExtraMappings>${xwiki.db.h2.extraMappings}</xwikiDbHbmH2ExtraMappings>
                  <xwikiDbVirtualMode>${xwiki.db.hbm.virtualMode}</xwikiDbVirtualMode>

                  <!-- Default configuration data for xwiki.cfg -->
                  <xwikiCfgPlugins>${xwiki.cfg.plugins}</xwikiCfgPlugins>
                  <xwikiCfgVirtual>${xwiki.cfg.virtual}</xwikiCfgVirtual>
                  <xwikiCfgVirtualUsepath>${xwiki.cfg.virtual.usepath}</xwikiCfgVirtualUsepath>
                  <xwikiCfgEditCommentMandatory>${xwiki.cfg.editcomment.mandatory}</xwikiCfgEditCommentMandatory>
                  <xwikiCfgDefaultSkin>${xwiki.cfg.defaultskin}</xwikiCfgDefaultSkin>
                  <xwikiCfgDefaultBaseSkin>${xwiki.cfg.defaultbaseskin}</xwikiCfgDefaultBaseSkin>
                  <xwikiCfgEncoding>${xwiki.cfg.encoding}</xwikiCfgEncoding>
                  <xwikiCfgAdditionalProperties>${xwiki.cfg.additionalproperties}</xwikiCfgAdditionalProperties>

                  <!-- Default configuration data for xwiki.properties -->
                  <xwikiPropertiesEnvironmentPermanentDirectory>${xwiki.properties.environment.permanentDirectory}</xwikiPropertiesEnvironmentPermanentDirectory>
                  <xwikiPropertiesExtensionOldFlavors>${xwiki.properties.extensions.oldflavors}</xwikiPropertiesExtensionOldFlavors>
                  <xwikiPropertiesDefaultWysiwygEditor>${xwiki.properties.defaultWysiwygEditor}</xwikiPropertiesDefaultWysiwygEditor>
                  <xwikiPropertiesAdditionalProperties>${xwiki.properties.additionalproperties}</xwikiPropertiesAdditionalProperties>
                </properties>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <!-- Ensure we don't have duplicates in WEB-INF/lib -->
        <plugin>
          <groupId>org.basepom.maven</groupId>
          <artifactId>duplicate-finder-maven-plugin</artifactId>
          <version>1.3.0</version>
          <executions>
            <execution>
              <id>war-check-duplicates</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
                <exceptions>
                  <!-- Xalan bundles a lot of other projects: org/apache/xml/**, org/apache/bcel/**, JLex/**,
                       java_cup/**, org/apache/regexp/**. In addition, it even has these jars in its source tree without
                       any indication about their versions... Thus there's isn't much we can do ATM but it means there's
                       an uncertainty about which version of those classes are used at runtime.
                       TODO: Find an alternative to Xalan or find a good maven packaging of it -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>xalan</groupId>
                        <artifactId>xalan</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>jakarta-regexp</groupId>
                        <artifactId>jakarta-regexp</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <packages>
                      <package>org.apache.regexp</package>
                    </packages>
                  </exception>
                  <!-- None of these should bundle org.w3c classes but at least they seem compatible.
                       See https://issues.apache.org/bugzilla/show_bug.cgi?id=49897,
                       https://issues.apache.org/bugzilla/show_bug.cgi?id=49206 and http://bugs.jython.org/issue2121 -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>org.apache.xmlgraphics</groupId>
                        <artifactId>batik-ext</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <classes>
                      <class>org.w3c.dom.ElementTraversal</class>
                      <class>org.w3c.dom.events.DocumentEvent</class>
                      <class>org.w3c.dom.events.Event</class>
                      <class>org.w3c.dom.events.EventException</class>
                      <class>org.w3c.dom.events.EventListener</class>
                      <class>org.w3c.dom.events.EventTarget</class>
                      <class>org.w3c.dom.events.MouseEvent</class>
                      <class>org.w3c.dom.events.MutationEvent</class>
                      <class>org.w3c.dom.events.UIEvent</class>
                    </classes>
                  </exception>
                  <!-- None of these should bundle org.w3c classes... Hoping that they are compatible... -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>jaxen</groupId>
                        <artifactId>jaxen</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <classes>
                      <class>org.w3c.dom.UserDataHandler</class>
                    </classes>
                  </exception>
                  <!-- This is a PITA. The classes are actually incompatible! We should do something about it but I
                       don't see a solution ATM... -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>org.w3c.css</groupId>
                        <artifactId>sac</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis-ext</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <packages>
                      <package>org.w3c.css.sac</package>
                    </packages>
                  </exception>
                  <!-- Logging shouldn't be configured by libraries! In any case since we route everything through
                       SLF4J, logging is configured by the SLF4J implementation used (e.g. Logback). -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>org.apache.axis</groupId>
                        <artifactId>axis</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>radeox</groupId>
                        <artifactId>radeox</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <resources>
                      <resource>simplelog.properties</resource>
                    </resources>
                  </exception>
                  <!-- The files are different but removing them would mean repackaging the JARs which is PITA.
                       Since the versions are the same for bc (1.52) there's a good chance the files are compatible. -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcmail-jdk15on</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcpkix-jdk15on</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcprov-jdk15on</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <resources>
                      <resource>META-INF/BCKEY.DSA</resource>
                      <resource>META-INF/BCKEY.SF</resource>
                    </resources>
                  </exception>
                  <!-- XStream includes both xapp and xmlpull and XAPP bundle somes classes of xmlpull.
                       See http://x-stream.github.io/jira/689/ for more.
                   -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>xmlpull</groupId>
                        <artifactId>xmlpull</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>xpp3</groupId>
                        <artifactId>xpp3_min</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>xpp3</groupId>
                        <artifactId>xpp3</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <packages>
                      <package>org.xmlpull</package>
                    </packages>
                  </exception>
                  <!-- Seems to be the same thing -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>xpp3</groupId>
                        <artifactId>xpp3</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <packages>
                      <package>javax.xml.namespace</package>
                    </packages>
                  </exception>
                  <!-- Does not seems to be an issue -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-core</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-rt-transports-http</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <resources>
                      <resource>META-INF/cxf/bus-extensions.txt</resource>
                    </resources>
                  </exception>
                  <!-- Seems to be the same thing -->
                  <exception>
                    <conflictingDependencies>
                      <dependency>
                        <groupId>commons-configuration</groupId>
                        <artifactId>commons-configuration</artifactId>
                      </dependency>
                      <dependency>
                        <groupId>org.apache.commons</groupId>
                        <artifactId>commons-configuration2</artifactId>
                      </dependency>
                    </conflictingDependencies>
                    <resources>
                      <resource>PropertyList-1.0.dtd</resource>
                      <resource>properties.dtd</resource>
                    </resources>
                  </exception>
                </exceptions>
                <ignoredResourcePatterns>
                  <!-- Exclude XWiki's Component registration file -->
                  <ignoredResourcePattern>META-INF/components.txt</ignoredResourcePattern>
                  <!-- Several libs have a README file -->
                  <ignoredResourcePattern>META-INF/README.txt</ignoredResourcePattern>
                  <!-- Several libs have a RELEASENOTES file -->
                  <ignoredResourcePattern>RELEASE_NOTES.TXT</ignoredResourcePattern>
                  <!-- JAXB2 plugin resources. TODO: Exclude them from the XWiki JARs -->
                  <ignoredResourcePattern>META-INF/sun-jaxb.episode</ignoredResourcePattern>
                  <ignoredResourcePattern>simple.xjb</ignoredResourcePattern>
                  <!-- JDOM resources -->
                  <ignoredResourcePattern>META-INF/jdom-info.xml</ignoredResourcePattern>
                  <!-- Sisu components -->
                  <ignoredResourcePattern>META-INF/sisu/javax.inject.Named</ignoredResourcePattern>
                  <!-- Eclipse projects generally contains about.html file -->
                  <ignoredResourcePattern>about.html</ignoredResourcePattern>
                  <!-- Usually contain licenses often having same file name -->
                  <ignoredResourcePattern>license/.*.txt</ignoredResourcePattern>
                  <ignoredResourcePattern>LICENSES.txt</ignoredResourcePattern>
                  <!-- ApplicationResources.properties is duplicated but that's ok since it's how we want it work, see:
                       http://extensions.xwiki.org/xwiki/bin/view/Extension/Localization+Module#HProvidetranslationbundleinajar
                   -->
                  <ignoredResourcePattern>ApplicationResources(_.*)?\.properties</ignoredResourcePattern>
                  <!-- Apache karaf stuff -->
                  <ignoredResourcePattern>features.xml</ignoredResourcePattern>
                  <!-- Weird failure that can only be reproduced on Jenkins agent
                       TODO: find out what it's about...
                   -->
                  <ignoredResourcePattern>builddef.lst</ignoredResourcePattern>
                </ignoredResourcePatterns>
                <ignoredClassPatterns>
                  <!-- Java 9 modules descriptor (should probably be fixed in the plugin) -->
                  <ignoredClassPattern>module-info</ignoredClassPattern>
                </ignoredClassPatterns>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <!-- Add Legacy modules -->
    <profile>
      <id>legacy</id>
      <properties>
        <!-- Set legacy list of plugins -->
        <xwiki.cfg.plugins>${xwiki.cfg.plugins.legacy}</xwiki.cfg.plugins>
        <!-- Set legacy dependencies -->
        <war.dependencies.artifactId>${war.dependencies.artifactId.legacy}</war.dependencies.artifactId>
        <!-- We depend on legacy artifacts on purpose -->
        <xwiki.enforcer.no-legacy-dependencies.skip>true</xwiki.enforcer.no-legacy-dependencies.skip>
      </properties>
    </profile>
    <profile>
      <id>mysql</id>
      <properties>
        <xwiki.db>mysql</xwiki.db>
        <xwiki.db.jdbc.groupId>mysql</xwiki.db.jdbc.groupId>
        <xwiki.db.jdbc.artifactId>mysql-connector-java</xwiki.db.jdbc.artifactId>
        <xwiki.db.jdbc.version>${mysql.version}</xwiki.db.jdbc.version>
        <xwiki.db.connection.url>jdbc:mysql://localhost/xwiki?useSSL=false</xwiki.db.connection.url>
        <xwiki.db.connection.username>xwiki</xwiki.db.connection.username>
        <xwiki.db.connection.password>xwiki</xwiki.db.connection.password>
        <xwiki.db.connection.driver_class>com.mysql.jdbc.Driver</xwiki.db.connection.driver_class>
        <xwiki.db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</xwiki.db.dialect>
        <xwiki.db.hbm.xwiki>xwiki.hbm.xml</xwiki.db.hbm.xwiki>
        <xwiki.db.hbm.feeds>feeds.hbm.xml</xwiki.db.hbm.feeds>
      </properties>
    </profile>
    <profile>
      <id>pgsql</id>
      <properties>
        <xwiki.db>pgsql</xwiki.db>
        <xwiki.db.jdbc.groupId>org.postgresql</xwiki.db.jdbc.groupId>
        <xwiki.db.jdbc.artifactId>postgresql</xwiki.db.jdbc.artifactId>
        <xwiki.db.jdbc.version>${pgsql.version}</xwiki.db.jdbc.version>
        <xwiki.db.connection.url>jdbc:postgresql:xwiki</xwiki.db.connection.url>
        <xwiki.db.connection.username>xwiki</xwiki.db.connection.username>
        <xwiki.db.connection.password>xwiki</xwiki.db.connection.password>
        <xwiki.db.connection.driver_class>org.postgresql.Driver</xwiki.db.connection.driver_class>
        <xwiki.db.dialect>org.hibernate.dialect.PostgreSQLDialect</xwiki.db.dialect>
        <xwiki.db.hbm.xwiki>xwiki.postgresql.hbm.xml</xwiki.db.hbm.xwiki>
        <xwiki.db.hbm.feeds>feeds.hbm.xml</xwiki.db.hbm.feeds>
        <xwiki.db.hbm.virtualMode>schema</xwiki.db.hbm.virtualMode>
      </properties>
    </profile>
    <profile>
      <id>derby</id>
      <properties>
        <xwiki.db>derby</xwiki.db>
        <xwiki.db.jdbc.groupId>org.apache.derby</xwiki.db.jdbc.groupId>
        <xwiki.db.jdbc.artifactId>derby</xwiki.db.jdbc.artifactId>
        <xwiki.db.jdbc.version>${derby.version}</xwiki.db.jdbc.version>
        <xwiki.db.connection.url>jdbc:derby:database;create=true</xwiki.db.connection.url>
        <xwiki.db.connection.username />
        <xwiki.db.connection.password />
        <xwiki.db.connection.driver_class>org.apache.derby.jdbc.EmbeddedDriver</xwiki.db.connection.driver_class>
        <xwiki.db.dialect>org.hibernate.dialect.DerbyDialect</xwiki.db.dialect>
        <xwiki.db.hbm.xwiki>xwiki.derby.hbm.xml</xwiki.db.hbm.xwiki>
        <xwiki.db.hbm.feeds>feeds.hbm.xml</xwiki.db.hbm.feeds>
      </properties>
    </profile>
  </profiles>
</project>
