<?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">
	<!-- JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware 
		LLC, and individual contributors as indicated by the @author tags. See the 
		copyright.txt in the distribution for a full listing of individual contributors. 
		This copyrighted material is made available to anyone wishing to use, modify, 
		copy, or redistribute it subject to the terms and conditions of the GNU Lesser 
		General Public License, v. 2.1. This program is distributed in the hope that 
		it will be useful, but WITHOUT A WARRANTY; without even the implied warranty 
		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 
		General Public License for more details. You should have received a copy 
		of the GNU Lesser General Public License, v.2.1 along with this distribution; 
		if not, write to the Free Software Foundation, Inc., 51 Franklin Street, 
		Fifth Floor, Boston, MA 02110-1301, USA. (C) 2009, @author JBoss Inc. (jonathan.halliday@redhat.com) -->
   <parent>
	   <groupId>org.jboss.narayana.osgi</groupId>
	   <artifactId>narayana-osgi-parent</artifactId>
	   <version>5.13.1.Final</version>
	   <relativePath>../pom.xml</relativePath>
   </parent>

   <modelVersion>4.0.0</modelVersion>

   <groupId>org.jboss.narayana.osgi</groupId>
   <artifactId>narayana-osgi-jta</artifactId>
   <packaging>bundle</packaging>

   <name>Narayana: OSGi Transaction Service Bundles - JTA</name>
   <description>Narayana: OSGi JTA Bundles</description>

   <properties>
	   <maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
           <version.org.jboss.spec.javax.transaction>1.0.0.Final</version.org.jboss.spec.javax.transaction>
	   <karaf.home>${project.build.directory}/apache-karaf-minimal-${version.apache.karaf}</karaf.home>
   </properties>

   <dependencies>
	   <dependency>
		   <groupId>org.osgi</groupId>
		   <artifactId>org.osgi.core</artifactId>
	   </dependency>
	   <dependency>
		   <groupId>org.osgi</groupId>
		   <artifactId>org.osgi.compendium</artifactId>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.osgi.metadata</groupId>
		   <artifactId>jbosgi-metadata</artifactId>
	   </dependency>
	   <dependency>
		   <groupId>org.osgi</groupId>
		   <artifactId>org.osgi.enterprise</artifactId>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.spec.javax.transaction</groupId>
		   <artifactId>jboss-transaction-api_1.2_spec</artifactId>
		   <version>${version.org.jboss.spec.javax.transaction}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.narayana.jta</groupId>
		   <artifactId>jta</artifactId>
		   <version>${project.version}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.narayana</groupId>
		   <artifactId>common</artifactId>
		   <version>${project.version}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
           <groupId>org.jboss.narayana.arjunacore</groupId>
		   <artifactId>arjuna</artifactId>
		   <version>${project.version}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss</groupId>
		   <artifactId>jboss-transaction-spi</artifactId>
		   <version>${version.org.jboss.jboss-transaction-spi}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.narayana.jts</groupId>
		   <artifactId>narayana-jts-integration</artifactId>
		   <version>${project.version}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.narayana.jts</groupId>
		   <artifactId>jtax</artifactId>
		   <version>${project.version}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.logging</groupId>
		   <artifactId>jboss-logging</artifactId>
		   <version>${version.org.jboss.logging.jboss-logging}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.apache.activemq</groupId>
		   <artifactId>artemis-journal</artifactId>
		   <version>${version.org.apache.activemq}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.apache.karaf.shell</groupId>
		   <artifactId>org.apache.karaf.shell.console</artifactId>
		   <version>${version.apache.karaf}</version>
		   <scope>provided</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.springframework</groupId>
		   <artifactId>spring-tx</artifactId>
		   <optional>true</optional>
		   <version>3.0.5.RELEASE</version>
	   </dependency>
	   <dependency>
		   <groupId>junit</groupId>
		   <artifactId>junit</artifactId>
		   <version>${version.junit}</version>
		   <scope>test</scope>
	   </dependency>
	   <dependency>
		   <groupId>org.jboss.arquillian.junit</groupId>
		   <artifactId>arquillian-junit-container</artifactId>
		   <scope>test</scope>
	   </dependency>
   </dependencies>
   <build>
	   <resources>
		   <resource>
			   <directory>${project.basedir}/src/main/resources</directory>
			   <filtering>true</filtering>
			   <includes>
				   <include>features.xml</include>
			   </includes>
		   </resource>
		   <resource>
			   <directory>${project.basedir}/src/main/resources</directory>
			   <filtering>false</filtering>
			   <includes>
				   <include>**/*</include>
			   </includes>
			   <excludes>
				   <exclude>features.xml</exclude>
			   </excludes>
		   </resource>
	   </resources>
	   <testResources>
		   <testResource>
			   <directory>src/test/resources</directory>
			   <filtering>true</filtering>
		   </testResource>
	   </testResources>
	   <pluginManagement>
		   <plugins>
			   <plugin>
				   <artifactId>maven-surefire-plugin</artifactId>
				   <configuration>
					   <skip>true</skip>
				   </configuration>
			   </plugin>
		   </plugins>
	   </pluginManagement>
	   <plugins>
      <plugin>
        <inherited>false</inherited>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
      <plugin>
			   <groupId>org.apache.felix</groupId>
			   <artifactId>maven-bundle-plugin</artifactId>
			   <version>${maven-bundle-plugin.version}</version>
			   <extensions>true</extensions>
			   <configuration>
				   <instructions>
					   <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
					   <Bundle-Version>${project.version}</Bundle-Version>
					   <Bundle-Activator>org.jboss.narayana.osgi.jta.internal.Activator</Bundle-Activator>
					   <Export-Package>
						   org.jboss.tm*;version=${version.org.jboss.jboss-transaction-spi},
						   org.jboss.narayana.osgi.jta;version=${project.version},
						   org.jboss.narayana.osgi.jta.command;version=${project.version},
						   javax.transaction*;version="1.2.0"
					   </Export-Package>
					   <Private-Package>
						   org.jboss.narayana.osgi.jta.internal,
						   javax.transaction*,
						   org.jboss.tm*
					   </Private-Package>
					   <Import-Package>
						   javax.management,
						   javax.naming,
						   javax.naming.spi,
						   javax.xml.parsers,
						   javax.xml.stream,
						   org.xml.sax,
						   org.xml.sax.helpers,
						   org.w3c.dom,
						   javax.transaction*,
						   org.osgi.framework,
						   org.osgi.framework.wiring,
						   org.osgi.service.cm,
						   org.osgi.service.log,
						   org.osgi.util.tracker,
						   org.springframework.*;resolution:=optional;version="[2.5,5)",
						   org.apache.felix.service.command;resolution:=optional,
						   org.apache.karaf.shell.api.action;resolution:=optional,
						   org.apache.karaf.shell.api.action.lifecycle;resolution:=optional,
						   javax.enterprise.util;resolution:=optional,
						   javax.interceptor;resolution:=optional,
						   javax.security.cert;resolution:=optional,
						   javax.enterprise.context;resolution:=optional
					   </Import-Package>
					   <Embed-Transitive>true</Embed-Transitive>
					   <Embed-Dependency>
						   jboss-logging;inline=false,
						   jta;inline=false,
						   jtax;inline=false,
						   orbportability;inline=false,
						   common;inline=false,
						   arjuna;inline=false,
						   narayana-jts-integration;inline=false,
						   artemis*;inline=false,
						   activemq*;inline=false,
						   netty*;inline=false
					   </Embed-Dependency>
					   <Provide-Capability>
						   osgi.service;effective:=active;objectClass=javax.transaction.TransactionManager,
						   osgi.service;effective:=active;objectClass=javax.transaction.TransactionSynchronizationRegistry,
						   osgi.service;effective:=active;objectClass=javax.transaction.UserTransaction
					   </Provide-Capability>
					   <Require-Capability>
						   osgi.service;effective:=active;resolution:=optional;cardinality:=multiple;filter:="(objectClass=org.jboss.tm.XAResourceRecovery)"
					   </Require-Capability>
					   <_include>src/main/resources/META-INF/MANIFEST.MF</_include>
					   <_removeheaders>Include-Resource,Private-Package,Embed*,Bundle-ClassPath</_removeheaders>
					   <Karaf-Commands>org.jboss.narayana.osgi.jta.command</Karaf-Commands>
			   </instructions>
		   </configuration>
	   </plugin>
	   <plugin>
		   <groupId>org.codehaus.mojo</groupId>
		   <artifactId>build-helper-maven-plugin</artifactId>
		   <executions>
			   <execution>
				   <id>attach-artifacts</id>
				   <phase>package</phase>
				   <goals>
					   <goal>attach-artifact</goal>
				   </goals>
				   <configuration>
					   <artifacts>
						   <artifact>
							   <file>target/classes/features.xml</file>
							   <type>xml</type>
							   <classifier>features</classifier>
						   </artifact>
					   </artifacts>
				   </configuration>
			   </execution>
		   </executions>
	   </plugin>
	   <plugin>
		   <groupId>org.apache.maven.plugins</groupId>
		   <artifactId>maven-surefire-plugin</artifactId>
		   <configuration combine.self="override">
			   <forkMode>always</forkMode>
			   <!-- j9 JBTM-2777 disable the osgi test until KARAF-3518 resolved -->
			   <excludes>
				   <exclude>**/OSGiJTATest.java</exclude>
			   </excludes>
		   </configuration>
	   </plugin>
	   </plugins>
   </build>
   <profiles>
      <profile>
          <id>release</id>
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-install-plugin</artifactId>
                      <executions>
                          <execution>
                              <id>default-install</id>
                              <phase>install</phase>
                          </execution>
                      </executions>
                      <inherited>false</inherited>
                  </plugin>
              </plugins>
          </build>
     </profile>
	   <profile>
		   <id>arq-karaf-managed</id>
		   <activation>
			   <activeByDefault>false</activeByDefault>
		   </activation>
		   <build>
			   <plugins>
				   <plugin>
					   <artifactId>maven-surefire-plugin</artifactId>
					   <executions>
						   <execution>
							   <id>integration-test</id>
							   <phase>integration-test</phase>
							   <goals>
								   <goal>test</goal>
							   </goals>
							   <configuration>
								   <skip>false</skip>
								   <argLine>${surefire.system.args}</argLine>
								   <redirectTestOutputToFile>true</redirectTestOutputToFile>
								   <workingDirectory>.</workingDirectory>
								   <systemPropertyVariables>
									   <log4j.configuration>file://${basedir}/src/test/resources/logging.properties</log4j.configuration>
									   <version.apache.karaf>${version.apache.karaf}</version.apache.karaf>
								   </systemPropertyVariables>
							   </configuration>
						   </execution>
					   </executions>
				   </plugin>
				   <plugin>
					   <artifactId>maven-dependency-plugin</artifactId>
					   <executions>
						   <execution>
							   <id>unpack-karaf</id>
							   <phase>pre-integration-test</phase>
							   <goals>
								   <goal>unpack</goal>
							   </goals>
							   <configuration>
								   <artifactItems>
									   <artifactItem>
										   <groupId>org.apache.karaf</groupId>
										   <artifactId>apache-karaf-minimal</artifactId>
										   <version>${version.apache.karaf}</version>
										   <type>tar.gz</type>
										   <outputDirectory>${project.build.directory}</outputDirectory>
									   </artifactItem>
								   </artifactItems>
							   </configuration>
						   </execution>
					   </executions>
				   </plugin>
				   <plugin>
					   <artifactId>maven-antrun-plugin</artifactId>
					   <inherited>false</inherited>
					   <executions>
						   <execution>
							   <phase>pre-integration-test</phase>
							   <goals>
								   <goal>run</goal>
							   </goals>
							   <configuration>
								   <target>
									   <copy todir="${karaf.home}/etc" overwrite="true">
										   <fileset dir="${project.build.directory}/test-classes/etc"/>
									   </copy>
									   <copy todir="${karaf.home}/system/org/jboss/narayana/osgi/narayana-osgi-jta/${project.version}"
										   	 file="${project.build.directory}/narayana-osgi-jta-${project.version}.jar"/>
								   </target>
							   </configuration>
						   </execution>
					   </executions>
				   </plugin>
			   </plugins>
		   </build>
		   <dependencies>
			   <dependency>
				   <groupId>org.jboss.arquillian.container</groupId>
				   <artifactId>arquillian-container-karaf-managed</artifactId>
				   <version>${version.org.jboss.arquillian.osgi.karaf}</version>
				   <scope>test</scope>
			   </dependency>
			   <dependency>
				   <groupId>org.jboss.arquillian.osgi</groupId>
				   <artifactId>arquillian-osgi-bundle</artifactId>
				   <version>${version.org.jboss.arquillian.osgi.karaf}</version>
				   <scope>test</scope>
			   </dependency>
		   </dependencies>
	   </profile>
   </profiles>
</project>
