<?xml version="1.0" encoding="UTF-8"?>
<!-- JBoss, Home of Professional Open Source Copyright 2013, 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">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.jboss.narayana.rts</groupId>
    <artifactId>restat</artifactId>
    <version>5.12.0.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>restat-integration</artifactId>
  <packaging>jar</packaging>

  <name>Narayana: restat integration</name>
  <description>REST-AT Integration</description>

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

  <dependencies>

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-client</artifactId>
      <version>${version.org.jboss.resteasy}</version>
    </dependency>

    <dependency>
      <groupId>org.jboss.narayana.arjunacore</groupId>
      <artifactId>arjuna</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.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <version>${version.org.jboss.logging.jboss-logging}</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-jaxrs</artifactId>
      <version>${version.org.jboss.resteasy}</version>
      <scope>provided</scope>
    </dependency>

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

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

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

    <dependency>
      <groupId>org.codehaus.jettison</groupId>
      <artifactId>jettison</artifactId>
      <version>${version.org.codehaus.jettison}</version>
      <scope>provided</scope>
    </dependency>

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

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

    <dependency>
      <groupId>org.jboss.narayana.jta</groupId>
      <artifactId>narayana-jta</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxb-provider</artifactId>
      <version>${version.org.jboss.resteasy}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jettison-provider</artifactId>
      <version>${version.org.jboss.resteasy}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>${version.commons-httpclient}</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>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/functional/*TestCase.java</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <inherited>false</inherited>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <showDeprecation>false</showDeprecation>
        </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>
          <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>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skip>false</skip>
              <includes>
                <include>**/*TestCase.java</include>
              </includes>
              <systemPropertyVariables combine.children="append">
                <server.jvm.args>${server.jvm.args}</server.jvm.args>
                <node.address>127.0.0.1</node.address>
              </systemPropertyVariables>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-dependencies</id>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <phase>test-compile</phase>
                <configuration>
                  <stripVersion>true</stripVersion>
                  <includeGroupIds>org.jboss.byteman</includeGroupIds>
                  <outputDirectory>${project.build.directory}/test-classes/lib</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </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>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>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skip>false</skip>
              <includes>
                <include>**/*TestCase.java</include>
              </includes>
              <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>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-dependencies</id>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <phase>test-compile</phase>
                <configuration>
                  <stripVersion>true</stripVersion>
                  <includeGroupIds>org.jboss.byteman</includeGroupIds>
                  <outputDirectory>${project.build.directory}/test-classes/lib</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>default-install</id>
                <phase>install</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>j9</id>
      <activation>
        <jdk>[1.9,11)</jdk>
      </activation>
      <properties>
        <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>
    </profile>
  </profiles>
</project>
