<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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.kie.server</groupId>
    <artifactId>kie-server-wars</artifactId>
    <version>7.18.0.Final</version>
  </parent>

  <artifactId>kie-server</artifactId>
  <packaging>pom</packaging>

  <name>KIE :: Execution Server :: Wars :: Distribution Wars</name>
  <description>KIE Execution Server Distribution Wars. Name of the module is just 'kie-server' so that the final WARs have nicer names.</description>

  <properties>
    <java.module.name>org.kie.server.distribution.wars</java.module.name>
    <org.kie.swagger.url>../services/rest/server/swagger.json</org.kie.swagger.url>
    <org.kie.swagger.title>Execution Server Documentation</org.kie.swagger.title>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-common</artifactId>
      <exclusions>
        <exclusion>
          <!-- Collides with 'xml-apis:xml-apis' -->
          <groupId>javax.xml.stream</groupId>
          <artifactId>stax-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
        <exclusion>
          <groupId>dom4j</groupId>
          <artifactId>dom4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.jboss.spec.javax.security.jacc</groupId>
          <artifactId>jboss-jacc-api_1.5_spec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-drools</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>uberfire-commons</artifactId>
          <groupId>org.uberfire</groupId>
        </exclusion>
        <exclusion>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-jbpm</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.jboss.spec.javax.transaction</groupId>
          <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>dom4j</groupId>
          <artifactId>dom4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.jboss.spec.javax.el</groupId>
          <artifactId>jboss-el-api_3.0_spec</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-jbpm-ui</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.jboss.spec.javax.transaction</groupId>
          <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>dom4j</groupId>
          <artifactId>dom4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.jboss.spec.javax.el</groupId>
          <artifactId>jboss-el-api_3.0_spec</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-case-mgmt</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.jboss.spec.javax.transaction</groupId>
          <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>dom4j</groupId>
          <artifactId>dom4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.jboss.spec.javax.el</groupId>
          <artifactId>jboss-el-api_3.0_spec</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-optaplanner</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.javassist</groupId>
          <artifactId>javassist</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-dmn</artifactId>
      <!-- TODO Exclusions? -->
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-swagger</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-jms</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-drools</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-jbpm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-jbpm-ui</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-optaplanner</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.javassist</groupId>
          <artifactId>javassist</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-dmn</artifactId>
      <!-- TODO Exclusions? -->
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-case-mgmt</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-swagger</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-rest-prometheus</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-swagger-ui</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-router-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
    </dependency>

    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-client</artifactId>
    </dependency>

    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-websocket-client</artifactId>
    </dependency>

    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-controller-websocket-common</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-services-ejb-timer</artifactId>
    </dependency>
    
    <!-- openshift -->
    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-services-openshift</artifactId>
    </dependency>

    <!-- image -->
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>jbpm-process-svg</artifactId>
      <exclusions>
        <exclusion>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- webcontainer dependencies -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-entitymanager</artifactId>
      <exclusions>
        <exclusion>
          <groupId>dom4j</groupId>
          <artifactId>dom4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-jta_1.1_spec</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-jta_1.1_spec</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate.common</groupId>
      <artifactId>hibernate-commons-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.jms</groupId>
      <artifactId>jboss-jms-api_2.0_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
    </dependency>

    <!-- Timer dependencies -->
    <dependency>
      <groupId>org.quartz-scheduler</groupId>
      <artifactId>quartz</artifactId>
      <scope>runtime</scope>
      <exclusions>
        <exclusion>
          <groupId>javax.transaction</groupId>
          <artifactId>jta</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- kie-ci dependency to avoid linkage errors on EAP/Wildfly -->
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-servlet</artifactId>
      <exclusions>
        <exclusion>
          <!-- We use the com.google.inject:guice:no_aop brought in by kie-ci -->
          <groupId>com.google.inject</groupId>
          <artifactId>guice</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Needed for correct functionality of JMS authentication when KieLoginModule is set as login-module in EAP. -->
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-security</artifactId>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-xjc</artifactId>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-hibernate-for-ee7</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-entitymanager</artifactId>
                  <version>${version.org.hibernate-4ee7}</version>
                  <type>jar</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-core</artifactId>
                  <version>${version.org.hibernate-4ee7}</version>
                  <type>jar</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jboss.logging</groupId>
                  <artifactId>jboss-logging</artifactId>
                  <version>${version.org.jboss.logging-4ee7}</version>
                  <type>jar</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.javassist</groupId>
                  <artifactId>javassist</artifactId>
                  <version>${version.org.javassist-4ee7}</version>
                  <type>jar</type>
                </artifactItem>
                <artifactItem>
                  <groupId>antlr</groupId>
                  <artifactId>antlr</artifactId>
                  <version>${version.antlr-4ee7}</version>
                  <type>jar</type>
                </artifactItem>
                <artifactItem>
                  <groupId>org.jboss</groupId>
                  <artifactId>jandex</artifactId>
                  <version>${version.org.jboss.jandex-4ee7}</version>
                  <type>jar</type>
                </artifactItem>
                <artifactItem>
                  <groupId>com.fasterxml</groupId>
                  <artifactId>classmate</artifactId>
                  <version>${version.com.fasterxml.classmate-4ee7}</version>
                  <type>jar</type>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/ee7-hibernate</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <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>
          <finalName>kie-server-${project.version}</finalName>
          <descriptors>
            <descriptor>src/main/assembly/assembly-ee8-container.xml</descriptor>
            <descriptor>src/main/assembly/assembly-ee7-container.xml</descriptor>
            <descriptor>src/main/assembly/assembly-servlet-container.xml</descriptor>
          </descriptors>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
            <!-- special manifest entries to allow usage of CXF on WebSphere -->
            <manifestEntries>
              <Ignore-Scanning-Archives>cxf-api-${version.org.apache.cxf}.jar,cxf-rt-bindings-soap-${version.org.apache.cxf}.jar,cxf-rt-bindings-xml-${version.org.apache.cxf}.jar,cxf-rt-core-${version.org.apache.cxf}.jar,cxf-rt-databinding-jaxb-${version.org.apache.cxf}.jar,cxf-rt-frontend-jaxws-${version.org.apache.cxf}.jar,cxf-rt-frontend-simple-${version.org.apache.cxf}.jar,cxf-rt-transports-http-${version.org.apache.cxf}.jar,cxf-rt-ws-addr-${version.org.apache.cxf}.jar,cxf-rt-ws-policy-${version.org.apache.cxf}.jar</Ignore-Scanning-Archives>
              <DisableIBMJAXWSEngine>true</DisableIBMJAXWSEngine>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
