<?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 5743 2009-10-15 07:43:15Z 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 - Database</name>
  <groupId>org.jbpm.jbpm3</groupId>
  <artifactId>jbpm-db</artifactId>
  <packaging>jar</packaging>

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

  <properties>
    <previous.version>3.2.5.SP5</previous.version>
  </properties>

  <profiles>
    <profile>
      <id>update</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>previous-version</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jbpm.jbpm3</groupId>
                      <artifactId>jbpm-db</artifactId>
                      <version>${previous.version}</version>
                    </artifactItem>
                  </artifactItems>
                  <outputDirectory>${previous.version.directory}</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>update-schema</id>
                <phase>compile</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <property name="project.output.dir" value="${project.build.outputDirectory}"/>
                    <property name="previous.version.dir" value="${previous.version.directory}"/>
                    <ant antfile="scripts/antrun-jbpmschema.xml" target="update-schema"
                      inheritRefs="true"/>
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

      <properties>
        <previous.version.directory>${project.build.directory}/${previous.version}</previous.version.directory>
      </properties>

      <dependencies>
        <dependency>
          <groupId>com.ibm</groupId>
          <artifactId>db2jcc</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>com.ibm</groupId>
          <artifactId>db2jcc_license_cu</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>com.sybase</groupId>
          <artifactId>jconnect</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>net.sourceforge.jtds</groupId>
          <artifactId>jtds</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>com.microsoft.sqlserver</groupId>
          <artifactId>msjdbc</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc14</artifactId>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>postgresql</groupId>
          <artifactId>postgresql</artifactId>
          <scope>runtime</scope>
        </dependency>
      </dependencies>

      <repositories>
        <repository>
          <id>qa.jboss.com</id>
          <url>http://www.qa.jboss.com/jdbc-drivers/maven2</url>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <!-- Dependencies -->
  <dependencies>
    <!-- jBPM Dependencies -->
    <dependency>
      <groupId>org.jbpm.jbpm3</groupId>
      <artifactId>jbpm-jpdl</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jbpm.jbpm3</groupId>
      <artifactId>jbpm-jpdl</artifactId>
      <classifier>config</classifier>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jbpm.jbpm3</groupId>
      <artifactId>jbpm-identity</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jbpm.jbpm3</groupId>
      <artifactId>jbpm-identity</artifactId>
      <classifier>config</classifier>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

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

    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>create-drop-schema</id>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <property name="project.output.dir" value="${project.build.outputDirectory}"/>
                <ant antfile="scripts/antrun-jbpmschema.xml" target="create-schema"
                  inheritRefs="true"/>
                <ant antfile="scripts/antrun-jbpmschema.xml" target="drop-schema"
                  inheritRefs="true"/>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <includes>
            <include>jbpm.jpdl.*.sql</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
