<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2014 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.drools</groupId>
    <artifactId>drools-wb-jcr2vfs-migration</artifactId>
    <version>7.4.1.Final</version>
  </parent>

  <artifactId>drools-wb-jcr2vfs-export</artifactId>

  <name>Drools Workbench - jcr2vfs - JCR to XML Exporter</name>
  <description>Exports the data of Guvnor 5 to XML</description>

  <properties>
    <!-- Use older WELD which is compatible with Guvnor 5.x. -->
    <version.org.jboss.weld.weld-api>1.1.Final</version.org.jboss.weld.weld-api>
    <version.org.jboss.weld.weld>1.1.31.Final</version.org.jboss.weld.weld>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.drools</groupId>
        <artifactId>droolsjbpm-parent</artifactId>
        <version>${version.org.drools.jcrGuvnor}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.drools</groupId>
        <artifactId>guvnor-jcr2vfs-migration-webapp-drools-as-jar</artifactId>
        <version>${version.org.drools.jcrGuvnor}</version>
        <classifier>war-as-jar</classifier>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>${version.org.apache.lucene.jcrGuvnor}</version>
      </dependency>
      <!-- Use newer SLF4J and Logback with better support for logging exceptions with stacktraces. -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${version.org.slf4j}</version>
      </dependency>
      <!-- Replacement for the above excluded 'commons-logging:commons-logging' -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${version.org.slf4j}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${version.ch.qos.logback}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>${version.ch.qos.logback}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-wb-jcr2vfs-migration-xml</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-wb-jcr2vfs-migration-common</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>guvnor-jcr2vfs-migration-webapp-drools-as-jar</artifactId>
      <classifier>war-as-jar</classifier>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>droolsjbpm-ide-common</artifactId>
      <exclusions>
        <exclusion>
          <groupId>bouncycastle</groupId>
          <artifactId>bcmail-jdk14</artifactId>
        </exclusion>
        <exclusion>
          <groupId>bouncycastle</groupId>
          <artifactId>bcprov-jdk14</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.bouncycastle</groupId>
          <artifactId>bctsp-jdk14</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>log4j-over-slf4j</artifactId>
    </dependency>
    <!-- Replacement for the above excluded 'commons-logging:commons-logging' -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>

    <!-- Introduced by drools-wb-jcr2vfs-migration-xml -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>guvnor-repository</artifactId>
      <exclusions>
        <exclusion>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.poi</groupId>
          <artifactId>poi</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.poi</groupId>
          <artifactId>poi-ooxml</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.poi</groupId>
          <artifactId>poi-ooxml-schemas</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.poi</groupId>
          <artifactId>poi-scratchpad</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>edu.ucar</groupId>
          <artifactId>netcdf</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.ws.rs</groupId>
          <artifactId>javax.ws.rs-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>guvnor-webapp-core</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
        </exclusion>
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-httpclient</groupId>
          <artifactId>commons-httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.allen-sauer.gwt.dnd</groupId>
          <artifactId>gwt-dnd</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.poi</groupId>
          <artifactId>poi</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.poi</groupId>
          <artifactId>poi-ooxml</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.poi</groupId>
          <artifactId>poi-ooxml-schemas</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.ejb</groupId>
          <artifactId>ejb-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.james</groupId>
          <artifactId>apache-mime4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.ws.rs</groupId>
          <artifactId>jsr311-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.web.bindery</groupId>
          <artifactId>requestfactory-server</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.jboss.spec.javax.ejb</groupId>
      <artifactId>jboss-ejb-api_3.2_spec</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>guvnor-api</artifactId>
    </dependency>

    <!-- gwt-servlet can not be (easily) excluded as the guvnor-webapp depends on quite a few classes from there -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.pdfbox</groupId>
      <artifactId>pdfbox</artifactId>
    </dependency>

    <!-- Weld Modules -->
    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld.se</groupId>
      <artifactId>weld-se-core</artifactId>
      <exclusions>
        <!-- The droolsjbpm-parent declares version 1.2 which does not seem to publicly available anymore.
             Excluding the artifact here and explicitly depending on jboss-el-api_3.0_spec (see below),
             which is available. The version difference - 1.2 vs 2.2 - should not be an issue. -->
        <exclusion>
          <groupId>javax.el</groupId>
          <artifactId>el-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.el</groupId>
      <artifactId>jboss-el-api_3.0_spec</artifactId>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.lingala.zip4j</groupId>
      <artifactId>zip4j</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <executions>
            <execution>
              <id>ban-duplicated-classes</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <banDuplicateClasses>
                    <dependencies>
                      <dependency>
                        <groupId>org.drools</groupId>
                        <artifactId>guvnor-jcr2vfs-migration-webapp-drools-as-jar</artifactId>
                        <ignoreClasses>
                          <!-- Legacy dependency, will never get fixed. -->
                          <ignoreClass>org.drools.guvnor.client.resources.WizardResources$WizardStyle</ignoreClass>
                          <ignoreClass>org.drools.guvnor.client.resources.WizardResources</ignoreClass>
                        </ignoreClasses>
                      </dependency>
                    </dependencies>
                  </banDuplicateClasses>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/assembly-export-with-deps.xml</descriptor>
          </descriptors>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
