<?xml version="1.0"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.jboss.soa.bpel</groupId>
  <artifactId>riftsaw-dao-jpa</artifactId>
  <name>ODE :: JPA DAO Impl</name>

  <parent>
    <groupId>org.jboss.soa.bpel</groupId>
    <artifactId>ode</artifactId>
    <version>2.2.0.20101001-M1</version>
  </parent>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jta_1.1_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.persistence</groupId>
      <artifactId>persistence-api</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.soa.bpel</groupId>
      <artifactId>riftsaw-bpel-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.soa.bpel</groupId>
      <artifactId>riftsaw-bpel-dao</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.soa.bpel</groupId>
      <artifactId>riftsaw-utils</artifactId>
    </dependency>
    <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xmlParserAPIs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.openjpa</groupId>
      <artifactId>openjpa</artifactId>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.serp</groupId>
      <artifactId>serp</artifactId>
    </dependency>

      <dependency>
           <groupId>org.jboss.bpm</groupId>
           <artifactId>activity-monitor-model</artifactId>
           <version>1.0.0-Beta1</version>
       </dependency>
      
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>openjpa-enhancer</id>
            <phase>process-classes</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <copy todir="${basedir}/target/classes-openjpa">
                  <fileset dir="${basedir}/target/classes">
                  	<include name="**/*" />
                  </fileset>
                </copy>
                <property name="maven.compile.classpath" refid="maven.compile.classpath"/>
                <path id="classpath">
                  <pathelement location="${basedir}/target/classes-openjpa"/>
                  <pathelement path="${maven.compile.classpath}"/>
                </path>
                <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="classpath"/>
                <openjpac directory="${basedir}/target/classes-openjpa">
                  <fileset dir="${basedir}/src/main">
                    <include name="**/*.java" />                    
                  </fileset>
                  <classpath refid="classpath"/>
                </openjpac>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <!-- copy orm.xml to classes folder for using custom sequence -->
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-orm-file</id>
            <phase>process-classes</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
              	<copy file="src/main/riftsaw/riftsaw-orm.xml" 
              		tofile="target/classes/META-INF/riftsaw-orm.xml" overwrite="true" />            		
              	<copy file="src/main/riftsaw/riftsaw-persistence.xml" 
              		tofile="target/classes/META-INF/persistence.xml" overwrite="true" />
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>                 
          <execution>
            <id>openjpa-enhancer-package</id>
            <phase>package</phase>
            <configuration>
              <classifier>openjpa</classifier>
              <classesDirectory>${project.build.directory}/classes-openjpa</classesDirectory>
            </configuration>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
        
    </plugins>
   </build>
  

</project>
