<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright The Narayana Authors
   SPDX short identifier: Apache-2.0
 -->
<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.jboss.narayana</groupId>
    <artifactId>narayana-all</artifactId>
    <version>7.3.0.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>jbosstxbridge</artifactId>
  <packaging>jar</packaging>
  <name>Narayana: txbridge</name>
  <description>Narayana: txbridge</description>
  <properties>
    <byteman.home>${project.build.directory}/byteman</byteman.home>
    <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>
    <checkstyle.skip>true</checkstyle.skip>
    <server.jvm.args>${jvm.args.other} ${jvm.args.memory} ${byteman.server.jvm.args} ${jvm.args.debug} ${jvm.args.modular}</server.jvm.args>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss.narayana</groupId>
        <artifactId>main-dependency-management</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.narayana</groupId>
        <artifactId>test-dependency-management</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>jakarta.transaction</groupId>
      <artifactId>jakarta.transaction-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.narayana.xts</groupId>
      <artifactId>jbossxts</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.ws</groupId>
      <artifactId>jbossws-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.narayana.jta</groupId>
      <artifactId>narayana-jta</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging-processor</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>jakarta.ejb</groupId>
      <artifactId>jakarta.ejb-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.byteman</groupId>
      <artifactId>byteman</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.byteman</groupId>
      <artifactId>byteman-dtest</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>jakarta.json</groupId>
      <artifactId>jakarta.json-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.parsson</groupId>
      <artifactId>parsson</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-transaction-spi</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.ws</groupId>
      <artifactId>jaxws-ri</artifactId>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>

  </dependencies>
  <build>
    <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>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>byteman.copy</id>
            <goals>
              <goal>copy</goal>
            </goals>
            <phase>process-test-resources</phase>
            <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>
            <goals>
              <goal>run</goal>
            </goals>
            <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"></copy>
                <replaceregexp file="${env.JBOSS_HOME}/standalone/configuration/test-disabled-context-propagation-standalone-xts.xml" match="&lt;default-context-propagation enabled=&quot;true&quot;/&gt;" replace="&lt;default-context-propagation enabled=&quot;false&quot;/&gt;"></replaceregexp>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>delete-disabled-context-propagation-configuration</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <skip>true</skip>
              <target unless="skipTests">
                <delete file="${env.JBOSS_HOME}/standalone/configuration/test-disabled-context-propagation-standalone-xts.xml"></delete>
              </target>
            </configuration>
          </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>
        <groupId>org.jboss.byteman</groupId>
        <artifactId>byteman-rulecheck-maven-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <packages>
            <package>org.jboss.jbossts.xts.recovery.participant.at</package>
          </packages>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>arq</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.wildfly.arquillian</groupId>
          <artifactId>wildfly-arquillian-container-managed</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <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>
    </profile>
    <profile>
      <id>arqIPv6</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.wildfly.arquillian</groupId>
          <artifactId>wildfly-arquillian-container-managed</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <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>
    </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>
  </profiles>
</project>
