<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY 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 along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<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.rts</groupId>
        <artifactId>restat</artifactId>
        <version>5.10.6.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>restat-bridge</artifactId>
    <name>Narayana: Bridge between REST-AT and JTA</name>

    <properties>
        <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>
        <modular.jdk.args/>
        <modular.jdk.props/>
        <server.jvm.args>
            ${jvm.args.other} ${jvm.args.memory} ${jvm.args.debug} ${jvm.args.modular}
        </server.jvm.args>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.jboss.narayana.rts</groupId>
            <artifactId>restat-integration</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.narayana.rts</groupId>
            <artifactId>restat-util</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>${version.org.jboss.resteasy}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.ws.rs</groupId>
            <artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
            <version>${version.javax.ws.rs-api}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <version>${version.org.jboss.resteasy}</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>org.jboss.ironjacamar</groupId>
            <artifactId>ironjacamar-spec-api</artifactId>
            <version>${version.org.jboss.ironjacamar}</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.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.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.1_spec</artifactId>
            <version>${version.org.jboss.spec.javax.ejb}</version>
            <scope>provided</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>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.codehaus.jettison</groupId>
            <artifactId>jettison</artifactId>
            <version>${version.org.codehaus.jettison}</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-submit</artifactId>
      <version>${version.org.jboss.byteman}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-transaction-spi</artifactId>
      <version>${version.org.jboss.jboss-transaction-spi}</version>
    </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <showDeprecation>false</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <includes>
                        <include>**/*TestCase.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <stripVersion>true</stripVersion>
                            <includeGroupIds>org.jboss.byteman</includeGroupIds>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
              <inherited>false</inherited>
              <groupId>org.sonatype.plugins</groupId>
              <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
    <profile>
      <id>j9</id>
      <activation>
        <jdk>[1.9,11)</jdk>
      </activation>
      <properties>
        <maven.compiler.source>1.9</maven.compiler.source>
        <maven.compiler.target>1.9</maven.compiler.target>
        <!-- a couple of the rest bridge tests a failing with
           java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
        <modular.jdk.args>-add-modules=java.xml,java.xml.bind,java.xml.ws</modular.jdk.args>
        <modular.jdk.args>-add-modules java.se.ee</modular.jdk.args>
           but the following does not resolve it. Instead I changed the way the test looks
           up rts transaction status
           -->
        <jvm.args.modular>--add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED</jvm.args.modular>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>default-compile</id>
                <configuration>
                  <compilerArgs>
                    <arg>--add-modules</arg>
                    <arg>java.xml.ws</arg>
                  </compilerArgs>
                </configuration>
              </execution>
              <execution>
                <id>default-testCompile</id>
                <configuration>
                  <compilerArgs>
                    <arg>--add-modules</arg>
                    <arg>java.xml.ws</arg>
                  </compilerArgs>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
        <profile>
            <id>arq</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.wildfly.arquillian</groupId>
                    <artifactId>wildfly-arquillian-container-managed</artifactId>
                    <version>${version.org.wildfly.arquillian}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.arquillian.protocol</groupId>
                    <artifactId>arquillian-protocol-servlet</artifactId>
                    <version>${version.org.jboss.arquillian.core}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <systemPropertyVariables combine.children="append">
                                <server.jvm.args>${server.jvm.args}</server.jvm.args>
                                <node.address>127.0.0.1</node.address>
                            </systemPropertyVariables>
                        </configuration>
                    </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>
                    <version>${version.org.wildfly.arquillian}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.arquillian.protocol</groupId>
                    <artifactId>arquillian-protocol-servlet</artifactId>
                    <version>${version.org.jboss.arquillian.core}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <argLine>${ipv6.server.jvm.args}</argLine>
                            <systemPropertyVariables combine.children="append">
                                <server.jvm.args>${server.jvm.args} ${ipv6.server.jvm.args}</server.jvm.args>
                                <node.address>[::1]</node.address>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>codeCoverage</id>
            <properties>
                <server.jvm.args>
                    ${jvm.args.other} ${jvm.args.memory} ${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>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
