<?xml version="1.0" encoding="UTF-8"?>

<!-- ====================================================================== -->
<!--  jBPM: Workflow in Java                                                -->
<!--                                                                        -->
<!--  Distributable under LGPL license.                                     -->
<!--  See terms of license at http://www.gnu.org.                           -->
<!-- ====================================================================== -->

<!-- $Id: pom.xml 6291 2010-05-04 01:55:40Z alex.guizar@jboss.com $ -->

<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>
  <name>JBoss jBPM3 - Core</name>
  <groupId>org.jbpm.jbpm3</groupId>
  <artifactId>jbpm-jpdl</artifactId>
  <packaging>jar</packaging>

  <!-- Parent -->
  <parent>
    <groupId>org.jbpm.jbpm3</groupId>
    <artifactId>jbpm</artifactId>
    <version>3.2.9</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>

  <!-- Dependencies -->
  <dependencies>
    <!-- Compile Dependencies -->
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
    </dependency>
    <dependency>
      <groupId>bsh</groupId>
      <artifactId>bsh</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>xml-apis</artifactId>
          <groupId>xml-apis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-core</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

    <!-- Provided Dependencies -->
    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Test Dependencies -->
    <dependency>
      <groupId>jaxen</groupId>
      <artifactId>jaxen</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sf.retrotranslator</groupId>
      <artifactId>retrotranslator-runtime</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.subethamail</groupId>
      <artifactId>subethasmtp-wiser</artifactId>
      <classifier>java14</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.subethamail</groupId>
      <artifactId>subethasmtp-smtp</artifactId>
      <classifier>java14</classifier>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- Plugins -->
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <finalName>${project.build.finalName}</finalName>
              <appendAssemblyId>true</appendAssemblyId>
              <descriptors>
                <descriptor>scripts/assembly-config.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <showDeprecation>false</showDeprecation>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>hibernate.*</exclude>
            <exclude>jbpm.cfg.xml</exclude>
            <exclude>jbpm-*-ds.xml</exclude>
            <exclude>jbpm.mail.templates.xml</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <property name="database" value="${database}" />
                <ant antfile="scripts/antrun-jbpm-config.xml" target="concat" />
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- Profiles -->
  <profiles>

    <!-- 
      Name: soa
      Desc: Customizations for the SOA build   
    -->
    <profile>
      <id>soa</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>process-resources</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <property name="database" value="${database}" />
                    <ant antfile="scripts/antrun-jbpm-config.xml" target="concat" />
                    <ant antfile="scripts/antrun-jbpm-config.xml" target="jbpm-cfg-xml-soa" />
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
      Name: jdk14
      Desc: Dependencies specific to JDK 1.4
    -->
    <profile>
      <id>jdk14</id>
      <activation>
        <jdk>1.4</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>xerces</groupId>
          <artifactId>xmlParserAPIs</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <properties>
        <surefire.jvm.args>-Xmx128m</surefire.jvm.args>
      </properties>
    </profile>

    <!--
      Name: db2
      Desc: DB2 Test Exclusions
    -->
    <profile>
      <id>db2</id>
      <activation>
        <property>
          <name>database</name>
          <value>db2</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
      Name: mssql
      Desc: SQL Server Test Exclusions   
    -->
    <profile>
      <id>mssql</id>
      <activation>
        <property>
          <name>database</name>
          <value>mssql</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>org/jbpm/job/executor/JobExecutorDbTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
      Name: oracle
      Desc: Oracle Test Exclusions
    -->
    <profile>
      <id>oracle</id>
      <activation>
        <property>
          <name>database</name>
          <value>oracle</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
