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

<!-- ====================================================================== -->
<!--                                                                        -->
<!--  JBoss, the OpenSource J2EE webOS                                      -->
<!--                                                                        -->
<!--  Distributable under LGPL license.                                     -->
<!--  See terms of license at http://www.gnu.org.                           -->
<!--                                                                        -->
<!-- ====================================================================== -->

<!-- $Id: pom.xml 5846 2009-10-29 12:51:35Z tom.baeyens@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">

  <!-- Module Info -->
  <modelVersion>4.0.0</modelVersion>
  <name>jBPM 4 - Examples</name>
  <groupId>org.jbpm.jbpm4</groupId>
  <artifactId>jbpm-examples</artifactId>
  <packaging>jar</packaging>

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

  <!-- Dependencies -->
  <dependencies>

    <dependency>
      <groupId>org.jbpm.jbpm4</groupId>
      <artifactId>jbpm-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm.jbpm4</groupId>
      <artifactId>jbpm-test-base</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jbpm.jbpm4</groupId>
      <artifactId>jbpm-jpdl</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jbpm.jbpm4</groupId>
      <artifactId>jbpm-test-base</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.woodstox</groupId>
      <artifactId>wstx-lgpl</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.subethamail</groupId>
      <artifactId>subethasmtp-wiser</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-test-jar</id>
            <phase>package</phase>
            <goals>
              <goal>test-jar</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>jbpm.*</exclude>
                <exclude>logging.properties</exclude>
                <exclude>META-INF/*</exclude>
              </excludes> 
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <!-- -Ddatabase= -->
    <profile>
      <id>run.database.testsuite</id>
      <activation>
        <property>
          <name>database</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>database-test-cfg-customization</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <echo message="database: ${database}" />
                    <mkdir dir="target/jdbc.properties" />
                    <copy todir="target/jdbc.properties" overwrite="true">
                      <fileset dir="../../qa/jdbc" />
                    </copy>
                    <copy todir="target/jdbc.properties" overwrite="true" failonerror="false">
                      <fileset dir="${user.home}/.jbpm4/jdbc" />
                    </copy>
                    <ant antfile="../distro/src/main/files/install/build.xml" target="create.cfg">
                      <property name="tx" value="standalone.testsuite.examples" />
                      <property name="mail.cfg" value="testsuite" />
                      <property name="database" value="${database}" />
                      <property name="cfg.dest.dir" value="target/test-classes" />
                      <property name="install.src.dir" value="../distro/src/main/files/install/src" />
                      <property name="jdbc.properties.dir" value="target/jdbc.properties" />
                    </ant> 
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>         
        </plugins>
      </build>
    </profile>

  </profiles>

</project>