<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>tomcat-all</artifactId>
    <groupId>org.jboss.narayana.tomcat</groupId>
    <version>5.9.0.Final</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>tomcat-jta</artifactId>
  <name>Narayana: Tomcat JTA integration</name>
  <build>
    <plugins>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <inherited>false</inherited>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <artifactSet>
                <includes>
                  <include>org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec</include>
                  <include>org.jboss.narayana:common</include>
                  <include>org.jboss.narayana.arjunacore:arjuna</include>
                  <include>org.jboss.narayana.jta:jta</include>
                  <include>org.jboss.narayana.jta:jdbc</include>
                  <include>org.jboss:jboss-transaction-spi</include>
                  <include>org.jboss.logging:jboss-logging</include>
                </includes>
              </artifactSet>
              <transformers>
                <transformer>
                  <manifestEntries>
                    <arjuna-properties-file>jbossts-properties.xml</arjuna-properties-file>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/Test*.java</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>arq-tomcat</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                </goals>
                <configuration>
                  <skip>false</skip>
                  <redirectTestOutputToFile>true</redirectTestOutputToFile>
                  <forkCount>0</forkCount>
                  <systemPropertyVariables>
                    <project.build.directory>${project.build.directory}</project.build.directory>
                    <version.org.jboss.narayana>${project.version}</version.org.jboss.narayana>
                    <version.org.jboss.resteasy>${version.org.jboss.resteasy}</version.org.jboss.resteasy>
                    <version.org.jboss.spec.javax.transaction>${version.org.jboss.spec.javax.transaction}</version.org.jboss.spec.javax.transaction>
                    <server.jvm.args>${server.jvm.args}</server.jvm.args>
                    <tomcat.user>arquillian</tomcat.user>
                    <tomcat.pass>arquillian</tomcat.pass>
                    <test.db.type>h2</test.db.type>
                    <version.postgresql>${version.postgresql}</version.postgresql>
                    <pgsql.user>dtf11</pgsql.user>
                    <pgsql.password>dtf11</pgsql.password>
                    <pgsql.servername>narayanaci1.eng.hst.ams2.redhat.com</pgsql.servername>
                    <pgsql.portnumber>5432</pgsql.portnumber>
                    <pgsql.databasename>jbossts</pgsql.databasename>
                    <version.com.h2database>${version.com.h2database}</version.com.h2database>
                    <container.database.image>postgres:10</container.database.image>
                    <container.database.driver.artifact>org.postgresql:postgresql:42.2.2</container.database.driver.artifact>
                    <container.database.driver.class>org.postgresql.Driver</container.database.driver.class>
                    <container.database.datasource.class.xa>org.postgresql.xa.PGXADataSource</container.database.datasource.class.xa>
                    <container.docker.daemon.api.url>tcp://127.0.0.1:2375</container.docker.daemon.api.url>
                    <container.name>narayana_db</container.name>
                    <container.database.username>narayana_user</container.database.username>
                    <container.database.password>narayana_pass</container.database.password>
                    <container.database.name>narayana_db</container.database.name>
                    <container.database.bind.host.ip>127.0.0.1</container.database.bind.host.ip>
                    <container.database.bind.host.port>5432</container.database.bind.host.port>
                    <container.timeout.waiting.for.tcp>240000</container.timeout.waiting.for.tcp>
                    <dballocator.host.port>http://your.db.allocator.example.com:8080</dballocator.host.port>
                    <dballocator.expression>postgresql94</dballocator.expression>
                    <dballocator.requestee>narayana-tomcat-ts</dballocator.requestee>
                    <dballocator.expiry.minutes>10</dballocator.expiry.minutes>
                    <dballocator.timeout.minutes>20</dballocator.timeout.minutes>
                    <dballocator.driver.url>http://your.fileserver.example.com/postgresql-42.1.1.jar</dballocator.driver.url>
                    <dballocator.driver.url.timeout.seconds>120</dballocator.driver.url.timeout.seconds>
                  </systemPropertyVariables>
                </configuration>
              </execution>
              <execution>
                <id>verify</id>
                <phase>verify</phase>
                <goals>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </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>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.container</groupId>
          <artifactId>arquillian-tomcat-managed-8</artifactId>
          <version>${version.org.jboss.arquillian.container.tomcat}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>codeCoverage</id>
      <properties>
        <server.jvm.args>${jvm.args.byteman} ${jvm.args.debug} ${jvm.args.jacoco}</server.jvm.args>
      </properties>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.5.2</version>
            <executions>
              <execution>
                <id>default-install</id>
                <phase>install</phase>
                <goals>
                  <goal>install</goal>
                </goals>
              </execution>
            </executions>
            <inherited>false</inherited>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.jboss.spec.javax.resource</groupId>
      <artifactId>jboss-connector-api_1.7_spec</artifactId>
      <version>1.0.0.Final</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <properties>
    <jvm.args.byteman>-Dorg.jboss.byteman.verbose -Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.jboss.byteman.transform.all
            -javaagent:${project.build.directory}/lib/byteman.jar=script:${project.build.directory}/test-classes/scripts.btm,listener:true</jvm.args.byteman>
    <server.jvm.args>${jvm.args.byteman} ${jvm.args.debug}</server.jvm.args>
  </properties>
</project>

