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

    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.

-->

<!-- $Rev: 703071 $ $Date: 2008-10-09 01:49:17 -0500 (Thu, 09 Oct 2008) $ -->

<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">
  <parent>
    <artifactId>container</artifactId>
    <groupId>org.apache.openejb</groupId>
    <version>3.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>openejb-core</artifactId>
  <packaging>jar</packaging>
  <name>OpenEJB :: Container :: Core</name>
  <properties>
    <openejb.osgi.import.pkg>
      javax.enterprise.deploy*;resolution:=optional,
      javax.jms*;resolution:=optional,
      javax.xml.registry*;resolution:=optional,
      javax.xml.rpc*;resolution:=optional,
      org.apache.activemq*;resolution:=optional,
      org.apache.catalina*;resolution:=optional,
      org.apache.commons.dbcp*;resolution:=optional,
      org.apache.xerces*;resolution:=optional,
      org.apache.xml.resolver*;resolution:=optional,
      *
    </openejb.osgi.import.pkg>
    <openejb.osgi.export>
      org.apache.openejb.client;partial=true;mandatory=partial;version=${openejb.osgi.export.version},
      org.apache.openejb*;version=${openejb.osgi.export.version}
    </openejb.osgi.export>
  </properties>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>
<!--
        <plugin>
            <groupId>com.envoisolutions.sxc</groupId>
            <artifactId>sxc-jaxb-maven-plugin</artifactId>
            <version>0.7-SNAPSHOT</version>
            <executions>
                <execution>
                    <configuration>
                        <classes>
                            <class>org.apache.openejb.config.sys</class>
                        </classes>
                    </configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.openejb</groupId>
                  <artifactId>openejb-javaagent</artifactId>
                  <version>${version}</version>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>pertest</forkMode>
          <argLine>"-javaagent:${basedir}/target/openejb-javaagent-${version}.jar" -enableassertions</argLine>
          <workingDirectory>${basedir}/target</workingDirectory>
          <systemProperties>
            <property>
              <name>openejb.home</name>
              <value>${basedir}/target/test-classes</value>
            </property>
            <property>
              <name>log4j.configuration</name>
              <value>file:///${basedir}/target/classes/embedded.logging.properties</value>
            </property>
          </systemProperties>
          <excludes>
            <exclude>**/TestHandler.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-classes</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <tstamp>
                  <format property="TSTAMP" pattern="hh:mm" />
                </tstamp>
                <replace file="target/classes/openejb-version.properties" token="@DATE-REPLACED-BY-MAVEN@" value="${DSTAMP}" />
                <replace file="target/classes/openejb-version.properties" token="@TIME-REPLACED-BY-MAVEN@" value="${TSTAMP}" />
                <property name="compile_classpath" refid="maven.compile.classpath" />
                <java classname="org.apache.openejb.util.MakeTxLookup">
                  <arg value="${project.build.directory}" />
                  <classpath>
                    <pathelement path="${compile_classpath}" />
                  </classpath>
                </java>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.apache.openejb.cli.Bootstrap</mainClass>
              <!--<addClasspath>true</addClasspath>-->
            </manifest>
            <manifestEntries>
              <Class-Path>openejb-loader-${version}.jar openejb-client-${version}.jar
                asm-finder-${xbeanVersion}.jar</Class-Path>
              <J2EE-DeploymentFactory-Implementation-Class>
                org.apache.openejb.config.VmDeploymentFactory</J2EE-DeploymentFactory-Implementation-Class>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rat-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>src/main/resources/META-INF/org.apache.openejb.cli/validate.examples</exclude>
            <exclude>src/main/resources/META-INF/org.apache.openejb.cli/validate.help</exclude>
            <exclude>src/main/resources/META-INF/org.apache.openejb.resource.jdbc.DataSourcePlugin/*</exclude>
            <exclude>src/main/resources/schema/ejb-jar_1_1.xsd</exclude>
            <exclude>src/main/resources/META-INF/services/org/apache/activemq/broker/openejb</exclude>
          </excludes>
        </configuration>
      </plugin>
	  <plugin>
        <groupId>org.apache.felix</groupId>
	    <artifactId>maven-bundle-plugin</artifactId>
	    <configuration>
	      <instructions>
	        <Bundle-Name>${artifactId}</Bundle-Name>
	        <Bundle-SymbolicName>${openejb.osgi.symbolic.name}</Bundle-SymbolicName>
	        <Export-Package>${openejb.osgi.export}</Export-Package>
	        <Import-Package>${openejb.osgi.import}</Import-Package>
	        <Private-Package>${openejb.osgi.private.pkg}</Private-Package>
	        <Implementation-Title>Apache OpenEJB</Implementation-Title>
	        <Implementation-Version>${project.version}</Implementation-Version>
	      </instructions>
	    </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>javaee-api</artifactId>
      <version>5.0-1</version>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>ejb31-api-experimental</artifactId>
      <version>${version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-loader</artifactId>
      <version>${version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-javaagent</artifactId>
      <version>${version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-jee</artifactId>
      <version>${version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-itests-app</artifactId>
      <version>${version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-itests-beans</artifactId>
      <version>${version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-itests-interceptor-beans</artifactId>
      <version>${version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-itests-interceptor-beans</artifactId>
      <version>${version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>openejb-itests-client</artifactId>
      <version>${version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
    </dependency>
    <!-- ActiveMQ -->
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-ra</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-core</artifactId>
    </dependency>
    <!-- End ActiveMQ -->
    <dependency>
      <groupId>org.apache.openjpa</groupId>
      <artifactId>openjpa</artifactId>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.serp</groupId>
      <artifactId>serp</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.components</groupId>
      <artifactId>geronimo-connector</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.components</groupId>
      <artifactId>geronimo-transaction</artifactId>
    </dependency>
    <dependency>
      <groupId>org.objectweb.howl</groupId>
      <artifactId>howl</artifactId>
    </dependency>
    <!-- JavaMail -->
    <dependency>
      <groupId>org.apache.geronimo.javamail</groupId>
      <artifactId>geronimo-javamail_1.4_mail</artifactId>
    </dependency>
    <!-- End: JavaMail -->
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-reflect</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>asm-finder</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-naming</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
    </dependency>
    <dependency>
      <groupId>idb</groupId>
      <artifactId>idb</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>commons-dbcp-all</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.swizzle</groupId>
      <artifactId>swizzle-stream</artifactId>
    </dependency>
    <!-- added temporarily till we get a fixed version of the dep report plugin -->
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <!-- webservices  -->
    <dependency>
      <groupId>wsdl4j</groupId>
      <artifactId>wsdl4j</artifactId>
    </dependency>
    <dependency>
      <groupId>xmlunit</groupId>
      <artifactId>xmlunit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <version>2.5.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-spring</artifactId>
      <version>3.4.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>openejb.debug</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <forkMode>pertest</forkMode>
              <argLine>"-javaagent:${basedir}/target/openejb-javaagent-${version}.jar" -enableassertions
                -agentlib:jdwp=transport=dt_socket,server=y,address=5005</argLine>
              <workingDirectory>${basedir}/target</workingDirectory>
              <systemProperties>
                <property>
                  <name>openejb.home</name>
                  <value>${basedir}/target/test-classes</value>
                </property>
                <property>
                  <name>log4j.configuration</name>
                  <value>file:///${basedir}/target/classes/embedded.logging.properties</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

