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

<!-- ====================================================================== -->
<!--  jBPM: Workflow in Java                                                -->
<!--                                                                        -->
<!--  Distributable under LGPL license.                                     -->
<!--  See terms of license at http://www.gnu.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>
  <name>jBPM3 - Core</name>
  <groupId>com.github.albfernandez</groupId>
  <artifactId>jbpm-jpdl</artifactId>
  <packaging>jar</packaging>

  <!-- Parent -->
  <parent>
    <groupId>com.github.albfernandez</groupId>
    <artifactId>jbpm</artifactId>
    <version>3.2.19.ayg</version>
  </parent>

  <!-- Dependencies -->
  <dependencies>
    <!-- Compile Dependencies -->
    <dependency>
      <groupId>bsh</groupId>
      <artifactId>bsh</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
	    <groupId>org.dom4j</groupId>
	    <artifactId>dom4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>5.4.31.Final</version>
    </dependency>
    <!-- Provided Dependencies -->
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <scope>provided</scope>
    </dependency>
    <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>org.jboss.spec.javax.transaction</groupId> -->
<!--       <artifactId>jboss-transaction-api_1.2_spec</artifactId> -->
<!--       <scope>provided</scope> -->
<!-- 	</dependency> -->
    <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Test Dependencies -->
    <dependency>
      <groupId>jaxen</groupId>
      <artifactId>jaxen</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.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>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.subethamail</groupId>
      <artifactId>subethasmtp-smtp</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2.2</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.33</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-ehcache</artifactId>
        <version>5.4.31.Final</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>net.sf.ehcache</groupId>
                <artifactId>ehcache-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-core</artifactId>
        <version>2.4.8</version>
    </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>
            <id>pack-config</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>scripts/assembly-config.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </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>
            <id>gen-config</id>
            <phase>process-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <property name="database" value="${database}"/>
                <property name="project.output.dir" value="${project.build.outputDirectory}"/>
                <ant antfile="scripts/antrun-config.xml" target="gen-hibernate-config"/>
              </tasks>
            </configuration>
          </execution>

          <execution>
            <id>gen-test-config</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <property name="project.output.dir" value="${project.build.outputDirectory}"/>
                <property name="project.test.output.dir" value="${project.build.testOutputDirectory}"/>
                <ant antfile="scripts/antrun-config.xml" target="gen-hibernate-test-config"/>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.javadoc.plugin}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <!-- database schema creation is costly; some drivers cache metadata -->
            <exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
            <!-- performance test is slow; misplaced along functional tests -->
            <exclude>org/jbpm/perf/PerformanceTest.java</exclude>
            <!-- Ignored Test Failures... -->
            <exclude>org/jbpm/jbpm2908/JBPM2908Test.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.apache.maven.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-antrun-plugin
                                    </artifactId>
                                    <versionRange>[1.3,)</versionRange>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute/>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
  </build>

  <!-- Profiles -->
  <profiles>
    <!--
      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>xercesImpl</artifactId>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
    </profile>

    <!--
      Name: sybase
      Desc: Sybase Test Exclusions
    -->
    <profile>
      <id>sybase</id>
      <activation>
        <property>
          <name>database</name>
          <value>sybase</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- JBPM-2958 driver fails to retrieve database metadata -->
                <exclude>org/jbpm/jbpm2958/TimerCalendarTest.java</exclude>
                <!-- default exclusions -->
                <exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
                <exclude>org/jbpm/perf/PerformanceTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
