<?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 5273 2009-07-09 12:44:54Z 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.0</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.jbpm.jbpm4</groupId>
      <artifactId>jbpm-console-reports</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>

  <profiles>
    <!-- -Ddatabase= -->
    <profile>
      <id>standalone.tests</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}" />
                    <available property="qa.database.props.available" file="../../qa/jdbc/${database}.properties" />
                    <echo message="qa.database.props.available: ${qa.database.props.available}" />
                    <copy file="../../qa/jdbc/${database}.properties" 
                          tofile="target/test-classes/jdbc.properties"
                          overwrite="true" />
                    <copy file="${user.home}/.jbpm4/jdbc/${database}.properties" 
                          tofile="target/test-classes/jdbc.properties"
                          overwrite="true"
                          failonerror="false"/>
                    <copy file="../../modules/distro/src/main/files/db/hibernate.cfg/${database}.hibernate.cfg.xml" 
                          tofile="target/test-classes/jbpm.hibernate.cfg.xml" 
                          overwrite="true">
                      <filterset>
                        <filtersfile file="target/test-classes/jdbc.properties" />
                      </filterset>
                    </copy>
                    <!-- replace file="target/test-classes/jbpm.hibernate.cfg.xml">
                      <replacetoken><![CDATA[<property name="hibernate.format_sql">true</property>]]></replacetoken>
                      <replacevalue><![CDATA[<property name="hibernate.format_sql">true</property>
    <property name="hibernate.hbm2ddl.auto">create-drop</property>]]></replacevalue>
                    </replace -->
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>         
        </plugins>
      </build>
    </profile>

    <!-- -Djboss.bind.address -->
    <profile>
      <id>integration.tests</id>
      <activation>
        <property>
          <name>jboss.bind.address</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.jbpm.jbpm4</groupId>
          <artifactId>jbpm-enterprise</artifactId>
          <scope>test</scope>
        </dependency>
        <!-- AS 5 Integration tests -->
        <dependency>
          <groupId>org.jboss.jbossas</groupId>
          <artifactId>jboss-as-client</artifactId>
          <scope>test</scope>
          <type>pom</type>
        </dependency>
        <dependency>
          <groupId>org.jboss.javaee</groupId>
          <artifactId>jboss-javaee</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>integration-test-cfg-customization</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <copy todir="target/test-classes" overwrite="true" failonerror="false">
                      <fileset dir="../distro/src/main/files/jboss/jbpm.cfg.remote.client" />
                    </copy>
                    <copy todir="target/test-classes" overwrite="true" failonerror="false">
                      <fileset dir="${user.home}/.jbpm4/jbpm.cfg.remote.client" />
                    </copy>
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

</project>