<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.jbpm</groupId>
    <artifactId>jbpm</artifactId>
    <version>5.2.0.Final</version>
  </parent>

  <artifactId>jbpm-persistence-jpa</artifactId>

  <name>jBPM :: JPA Persistence</name>
  <description>jBPM JPA Persistence</description>

  <build>
    <testResources>
        <testResource>
            <!-- neccesary in order to apply database/H2 properties -->
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
        </testResource>
    </testResources>
  
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <archive>
                <manifestFile>META-INF/MANIFEST.MF</manifestFile>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <manifestLocation>META-INF</manifestLocation>
          <instructions>
            <_removeheaders>Ignore-Package</_removeheaders>
            <Bundle-SymbolicName>org.jbpm.flow-persistence-jpa;singleton:=true</Bundle-SymbolicName>
            <Require-Bundle>org.drools.core;bundle-version="${drools.osgi.version}",org.drools.compiler;bundle-version="${drools.osgi.version}"</Require-Bundle>
            <Import-Package>*</Import-Package>
            <Export-Package>org.jbpm.persistence.*</Export-Package>
            <DynamicImport-Package>*</DynamicImport-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <!--  ensure that db files are deleted before _any_ run 
              otherwise we get tests failing because of leftover db's -->
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
         <filesets>
            <fileset>
              <directory>${basedir}</directory>
              <includes>
                <include>btm*</include>
                <include>JPADroolsFlow.*.db</include>
              </includes>
            </fileset>
         </filesets>
        </configuration>
      </plugin>
    </plugins>
  </build>
    
  <dependencies> 	       
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-flow-builder</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-persistence-jpa</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-annotations</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-persistence-jpa</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>    
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.btm</groupId>
      <artifactId>btm</artifactId>
      <scope>test</scope>
    </dependency> 
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- Following 2 dependencies needed for making the build work with JDK5 -->
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-xjc</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  
</project>
