<?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.arjunacore</groupId>
    <artifactId>arjunacore-all</artifactId>
    <version>5.12.4.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>arjuna</artifactId>
  <name>Narayana: ArjunaCore arjuna</name>
  <description>Narayana: ArjunaCore Arjuna</description>
  <packaging>jar</packaging>

  <build>
    <sourceDirectory>classes</sourceDirectory>
    <resources>
      <resource>
        <directory>etc</directory>
      </resource>
    </resources>
    <testSourceDirectory>tests/classes</testSourceDirectory>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>tests/byteman-scripts</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!-- exclude everything by default then the not-ibmorb and ibmorb profiles can
               selectively include/exclude specific tests -->
          <excludes>
            <exclude>**/*.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <inherited>false</inherited>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>com/arjuna/ats/arjuna/tools/stats/TxPerfGraph.java</exclude>
            <exclude>com/arjuna/ats/arjuna/tools/stats/TxPerfPlugin.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <inherited>false</inherited>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.jboss.narayana</groupId>
      <artifactId>common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>artemis-journal</artifactId>
      <version>${version.org.apache.activemq}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>io.netty</groupId>
          <artifactId>netty</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.mashona</groupId>
      <artifactId>mashona-logwriting</artifactId>
      <version>${version.io.mashona}</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.narayana</groupId>
      <artifactId>common</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.byteman</groupId>
      <artifactId>byteman-bmunit</artifactId>
      <version>${version.org.jboss.byteman}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>${version.com.h2database}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.narayana</groupId>
      <artifactId>test-utils</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <!-- always run this test configuraton unless the ibmorb profile is active -->
      <id>not-ibmorb</id>
      <activation>
        <property>
          <name>!ibmorb-enabled</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <useManifestOnlyJar>false</useManifestOnlyJar>
              <excludes>
                <!-- exclude tests that load the byteman agent (BMUnitRunner) -->
                <exclude>**/RecoveryManagerStartStopTest.java</exclude>
                <exclude>**/LogStoreTest2.java</exclude>
                <exclude>**/LogStoreRecoveryTest.java</exclude>
                <exclude>**/ReaperMonitorTest.java</exclude>
                <exclude>**/ReaperTestCase3.java</exclude>
                <exclude>**/ReaperTestCase2.java</exclude>
                <exclude>**/ReaperTestCase.java</exclude>
                <!-- not sure why these are excluded -->
                <exclude>**/resources/**</exclude>
                <exclude>**/DummyCheckedAction.java</exclude>
                <exclude>**/MyAccess.java</exclude>
                <exclude>**/Worker.java</exclude>
                <exclude>**/BasicCrashRecord.java</exclude>
                <exclude>**/DummyRecoveryModule.java</exclude>
                <exclude>**/CrashAbstractRecord*.java</exclude>
                <exclude>**/RecoveryTransaction.java</exclude>
                <exclude>**/UserDefFirst0Setup.java</exclude>
                <exclude>**/CachedTest.java</exclude>
                <!-- LogStressTest2 takes too long - needs moving to /qa -->
                <exclude>**/LogStressTest2.java</exclude>
                <!-- auxilairy code used by reaper test classes -->
                <exclude>**/reaper/ReaperTestCaseControl.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>linux-windows</id>
      <activation>
        <file>
          <exists>${java.home}/../lib/tools.jar</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>sun.jdk</groupId>
          <artifactId>jconsole</artifactId>
          <version>${version.sun.jdk}</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/jconsole.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>os-x</id>
      <activation>
        <file>
          <exists>${java.home}/bundle/Classes/classes.jar</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>sun.jdk</groupId>
          <artifactId>jconsole</artifactId>
          <version>${version.sun.jdk}</version>
          <scope>system</scope>
          <systemPath>${java.home}/bundle/Classes/jconsole.jar</systemPath>
        </dependency>
      </dependencies>
    </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>
    <!--
    <profile>
      <id>sybase-jdbc-store</id>
      <dependencies>
        <dependency>
          <groupId>com.sybase.jConnect</groupId>
          <artifactId>jconn3</artifactId>
          <version>${version.com.sybase.jConnect}</version>
          <scope>system</scope>
          <systemPath>${orson.jar.location}/../qa/dbdrivers/jConnect-6_0/classes/jconn3.jar</systemPath>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>sybasejbossts-properties.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    -->
    <profile>
      <id>oracle-jdbc-store</id>
      <dependencies>
        <dependency>
          <groupId>com.oracle.database.jdbc</groupId>
          <artifactId>ojdbc8</artifactId>
          <version>${version.com.oracle}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>oraclejbossts-properties.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>db2-jdbc-store</id>
      <dependencies>
        <dependency>
          <groupId>com.ibm.db2</groupId>
          <artifactId>jcc</artifactId>
          <version>${version.com.ibm}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>db2jbossts-properties.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>postgres-jdbc-store</id>
      <dependencies>
        <dependency>
          <groupId>org.postgresql</groupId>
          <artifactId>postgresql</artifactId>
          <version>${version.postgresql}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>postgresjbossts-properties.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>mysql-jdbc-store</id>
      <dependencies>
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>${version.mysql}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>mysqljbossts-properties.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>mariadb-jdbc-store</id>
      <dependencies>
        <dependency>
          <groupId>org.mariadb.jdbc</groupId>
          <artifactId>mariadb-java-client</artifactId>
          <version>${version.mariadb}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>mariadbjbossts-properties.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
    <profile>
      <id>mssql-jdbc-store</id>
      <dependencies>
        <dependency>
          <groupId>com.microsoft.sqlserver</groupId>
          <artifactId>sqljdbc4</artifactId>
          <version>${version.com.microsoft.sqlserver}</version>
          <systemPath>${orson.jar.location}/../qa/dbdrivers/mssql2005_sqljdbc_2.0/enu/sqljdbc4.jar</systemPath>
          <scope>system</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>mssqljbossts-properties.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    -->
    <profile>
      <id>community</id>
      <dependencies>
        <dependency>
          <groupId>orson</groupId>
          <artifactId>orson</artifactId>
          <version>${version.orson}</version>
          <scope>system</scope>
          <systemPath>${orson.jar.location}/orson-0.5.0.jar</systemPath>
        </dependency>
        <dependency>
          <groupId>jfree</groupId>
          <artifactId>jfreechart</artifactId>
          <version>${version.jfree}</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <inherited>false</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration combine.children="append">
              <excludes>
              </excludes>
            </configuration>

          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>codeCoverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- stress tests are not unit tests -->
                <exclude>**/LogStressTest2.java</exclude>
              </excludes>
              <systemProperties>
                <property>
                  <name>com.arjuna.ats.arjuna.common.propertiesFile</name>
                  <value>h2jbossts-properties.xml</value>
                </property>
              </systemProperties>

            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ibmorb</id>
      <activation>
        <property>
          <name>ibmorb-enabled</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>surefire-ibmorb</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <excludes>
                    <!--
                    BMUnit uses a special, /optional/ capability of the JVM to load the
                    Byteman agent into a running JVM (the agent is the bit of Byteman which
                    injects rules into bytecode) but the IBM jdk does not support the option.
                    It is possible to load the agent from the java command line but BMUNit
                    chooses to load the agent on demand. The fix is use the latter stragegy
                    when running with the IBM jdk. TODO
                    -->
                    <exclude>**/RecoveryManagerStartStopTest.java</exclude>
                    <exclude>**/ReaperTestCase3.java</exclude>
                    <exclude>**/ReaperTestCase2.java</exclude>
                    <exclude>**/ReaperTestCase.java</exclude>
                    <exclude>**/ReaperMonitorTest.java</exclude>
                    <exclude>**/LogStoreTest2.java</exclude>
                    <exclude>**/LogStoreRecoveryTest.java</exclude>
                    <exclude>**/LogStoreRecoveryTest.java</exclude>
                    <!-- stress tests don't belong in unit tests -->
                    <exclude>**/LogStressTest*.java</exclude>
                  </excludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
