<?xml version="1.0" encoding="UTF-8"?>
<!-- JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware 
	LLC, and others contributors as indicated by the @authors tag. All rights 
	reserved. 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. -->
<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>
        <groupId>org.jboss.narayana</groupId>
        <artifactId>narayana-all</artifactId>
        <version>5.13.1.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>jbosstxbridge</artifactId>
    <name>Narayana: txbridge</name>
    <description>Narayana: txbridge</description>
    <packaging>jar</packaging>
    <properties>
        <byteman.home>${project.build.directory}/byteman</byteman.home>
        <ipv6.server.jvm.args>-Djboss.bind.address=[::1] -Djboss.bind.address.management=[::1] -Djboss.bind.address.unsecure=[::1] -Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true</ipv6.server.jvm.args>
        <byteman.server.jvm.args>
            -Dorg.jboss.byteman.debug=true -Dorg.jboss.byteman.verbose=true -Dorg.jboss.byteman.contrib.dtest.rmiregistry.port=1199
            -Djboss.modules.system.pkgs=org.jboss.byteman
            -javaagent:${byteman.home}/byteman.jar=port:9091,listener:true,sys:${byteman.home}/byteman-dtest.jar
        </byteman.server.jvm.args>
        <server.jvm.args>
            ${jvm.args.other} ${jvm.args.memory} ${byteman.server.jvm.args} ${jvm.args.debug} ${jvm.args.modular}
        </server.jvm.args>
        <sortpom.skip>true</sortpom.skip>
    </properties>
    <build>
        <plugins>
            <plugin>
              <inherited>false</inherited>
              <groupId>org.sonatype.plugins</groupId>
              <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>byteman.copy</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jboss.byteman</groupId>
                                    <artifactId>byteman</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jboss.byteman</groupId>
                                    <artifactId>byteman-dtest</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${byteman.home}</outputDirectory>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>create-disabled-context-propagation-configuration</id>
                        <phase>process-test-sources</phase>
                        <configuration>
                            <skip>true</skip>
                            <target unless="skipTests">
                                <copy
                                    file="${env.JBOSS_HOME}/standalone/configuration/standalone-xts.xml"
                                    tofile="${env.JBOSS_HOME}/standalone/configuration/test-disabled-context-propagation-standalone-xts.xml" />
                                <replaceregexp
                                    match="&lt;default-context-propagation enabled=&quot;true&quot;/&gt;"
                                    replace="&lt;default-context-propagation enabled=&quot;false&quot;/&gt;"
                                    file="${env.JBOSS_HOME}/standalone/configuration/test-disabled-context-propagation-standalone-xts.xml" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>delete-disabled-context-propagation-configuration</id>
                        <phase>test</phase>
                        <configuration>
                            <skip>true</skip>
                            <target unless="skipTests">
                                <delete
                                    file="${env.JBOSS_HOME}/standalone/configuration/test-disabled-context-propagation-standalone-xts.xml" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${env.JBOSS_HOME}/standalone/configuration</directory>
                            <includes>
                                <include>test-disabled-context-propagation-standalone-xts.xml</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <inherited>false</inherited>
                <groupId>org.jboss.byteman</groupId>
                <artifactId>byteman-rulecheck-maven-plugin</artifactId>
                <configuration>
                    <packages>
                        <package>org.jboss.jbossts.xts.recovery.participant.at</package>
                    </packages>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
        	<plugins>
        		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        		<plugin>
        			<groupId>org.eclipse.m2e</groupId>
        			<artifactId>lifecycle-mapping</artifactId>
        			<version>1.0.0</version>
        			<configuration>
        				<lifecycleMappingMetadata>
        					<pluginExecutions>
        						<pluginExecution>
        							<pluginExecutionFilter>
        								<groupId>
        									org.apache.maven.plugins
        								</groupId>
        								<artifactId>
        									maven-dependency-plugin
        								</artifactId>
        								<versionRange>
        									[2.1,)
        								</versionRange>
        								<goals>
        									<goal>copy</goal>
        								</goals>
        							</pluginExecutionFilter>
        							<action>
        								<ignore></ignore>
        							</action>
        						</pluginExecution>
        					</pluginExecutions>
        				</lifecycleMappingMetadata>
        			</configuration>
        		</plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <!--
                                This test is disabled due to the JVM crash.
                                And it is known JDK issue https://bugs.openjdk.java.net/browse/JDK-8210457
                            -->
                            <exclude>**/InboundCrashRecoveryTests.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencies>
        <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>
            <!-- JCA API -->
            <groupId>org.jboss.ironjacamar</groupId>
            <artifactId>ironjacamar-spec-api</artifactId>
            <version>${version.org.jboss.ironjacamar}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.narayana.xts</groupId>
            <artifactId>jbossxts</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.ws</groupId>
            <artifactId>jbossws-api</artifactId>
            <version>${version.org.jboss.ws}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.narayana.jta</groupId>
            <artifactId>narayana-jta</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>${version.commons-httpclient}</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.jboss.logging</groupId>
            <artifactId>jboss-logging-processor</artifactId>
            <version>${version.org.jboss.logging.jboss-logging-processor}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.1_spec</artifactId>
            <version>${version.org.jboss.spec.javax.ejb}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
            <version>${version.org.jboss.spec.javax.servlet}</version>
            <scope>test</scope>
        </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>
            <version>${version.org.jboss.arquillian.core}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman</artifactId>
            <version>${version.org.jboss.byteman}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman-dtest</artifactId>
            <version>${version.org.jboss.byteman}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${version.org.apache.httpcomponents}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-api</artifactId>
            <version>${version.jakarta.json-api}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
            <version>${version.fasterxml.jackson}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>${version.glassfish.json}</version>
            <scope>test</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>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>${version.jaxb}</version>
        <scope>provided</scope>
    </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
            <version>${version.jaxb}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>${version.jaxb}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-ri</artifactId>
            <version>${version.jaxws-ri}</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

    </dependencies>
	<profiles>
		<profile>
			<id>arq</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<!-- Prevent test and server output appearing in console. -->
							<redirectTestOutputToFile>true</redirectTestOutputToFile>
							<enableAssertions>true</enableAssertions>
							<!-- Tests to execute. -->
							<includes>
								<include>**/*Tests.java</include>
							</includes>
							<!-- System properties passed to test cases -->
							<systemPropertyVariables>
								<!-- Used in arquillian.xml - arguments for all JBoss AS instances. -->
								<server.jvm.args>${server.jvm.args}</server.jvm.args>
								<java.rmi.server.codebase>file://target/test-classes/</java.rmi.server.codebase>
								<node.address>localhost</node.address>
							</systemPropertyVariables>
                            <skip>false</skip>
						</configuration>
					</plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>create-disabled-context-propagation-configuration</id>
                                <configuration>
                                    <skip>${maven.test.skip}</skip>
                                </configuration>
                            </execution>
                            <execution>
                                <id>delete-disabled-context-propagation-configuration</id>
                                <configuration>
                                    <skip>${maven.test.skip}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
				</plugins>
			</build>
			<dependencies>
				<dependency>
					<groupId>org.wildfly.arquillian</groupId>
					<artifactId>wildfly-arquillian-container-managed</artifactId>
					<version>${version.org.wildfly.arquillian}</version>
					<scope>test</scope>
                        <!-- exclude logmanager because an incompatible version is pulled in -->
                        <exclusions>
                            <exclusion>
                                <artifactId>org.jboss.logmanager</artifactId>
                                <groupId>jboss-logmanager</groupId>
                            </exclusion>
                        </exclusions>
               	    </dependency>
                    <dependency>
                        <groupId>org.jboss.logmanager</groupId>
                        <artifactId>jboss-logmanager</artifactId>
                        <version>${version.org.jboss.logmanager}</version>
                        <scope>provided</scope>
                    </dependency>
			</dependencies>
		</profile>
		<profile>
			<id>arqIPv6</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<CLI_IPV6_OPTS>-Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true</CLI_IPV6_OPTS> 
							<!-- Prevent test and server output appearing in console. -->
							<redirectTestOutputToFile>true</redirectTestOutputToFile>
							<enableAssertions>true</enableAssertions>
							<!-- Tests to execute. -->
							<includes>
								<include>**/*Tests.java</include>
							</includes>
							<!-- System properties passed to test cases -->
							<systemPropertyVariables>
								<!-- Used in arquillian.xml - arguments for all JBoss AS instances. -->
								<server.jvm.args>${server.jvm.args} ${ipv6.server.jvm.args}</server.jvm.args>
								<java.rmi.server.codebase>file://target/test-classes/</java.rmi.server.codebase>
								<node.address>[::1]</node.address>
							</systemPropertyVariables>
                            <skip>false</skip>
						</configuration>
					</plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>create-disabled-context-propagation-configuration</id>
                                <configuration>
                                    <skip>${maven.test.skip}</skip>
                                </configuration>
                            </execution>
                            <execution>
                                <id>delete-disabled-context-propagation-configuration</id>
                                <configuration>
                                    <skip>${maven.test.skip}</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
				</plugins>
			</build>
			<dependencies>
				<dependency>
					<groupId>org.wildfly.arquillian</groupId>
					<artifactId>wildfly-arquillian-container-managed</artifactId>
					<version>${version.org.wildfly.arquillian}</version>
					<scope>test</scope>

					<!-- exclude logmanager because an incompatible version is pulled in
					  -->
					<exclusions>
						<exclusion>
							<artifactId>org.jboss.logmanager</artifactId>
							<groupId>jboss-logmanager</groupId>
						</exclusion>
					</exclusions>
				</dependency>
				<dependency>
					<groupId>org.jboss.logmanager</groupId>
					<artifactId>jboss-logmanager</artifactId>
					<version>${version.org.jboss.logmanager}</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
		</profile>
        <profile>
            <id>codeCoverage</id>
            <properties>
                <server.jvm.args>
                    ${jvm.args.other} ${jvm.args.memory} ${byteman.server.jvm.args} ${jvm.args.debug} ${jvm.args.jacoco} ${jvm.args.modular}
                </server.jvm.args>
            </properties>
        </profile>
        <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>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/main/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <source>8</source>
                            <detectOfflineLinks>false</detectOfflineLinks>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
	</profiles>
</project>
