<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
  ~ Copyright 2017 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jboss.narayana.rts</groupId>
        <artifactId>rest-tx</artifactId>
        <version>5.9.9.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>lra-parent</artifactId>
    <name>LRA Parent</name>
    <description>LRA Parent</description>
    <packaging>pom</packaging>

    <properties>
        <version.json.api>1.1</version.json.api>
        <version.jackson>2.8.11.2</version.jackson>

        <version.jboss-interceptors>1.0.1.Final</version.jboss-interceptors>
        <version.jaxrs-api>2.1</version.jaxrs-api>
        <version.cdi-api>2.0</version.cdi-api>
        <version.junit>4.12</version.junit>

        <version.arquillian>1.2.1.Final</version.arquillian> <!-- cannot use the up-to-date Arquillian https://issues.jboss.org/browse/THORN-2090 -->
        <version.microprofile.lra.api>1.0-RC1</version.microprofile.lra.api>
        <version.microprofile.lra.tck>1.0-RC1</version.microprofile.lra.tck>

        <version.org.jboss.weld.se>3.1.1.Final</version.org.jboss.weld.se>
        <version.org.jboss.shrinkwrap>1.2.6</version.org.jboss.shrinkwrap>
      
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <test.logs.to.file>false</test.logs.to.file>
        <skipITs>true</skipITs> <!-- integration tests are disabled by default, use profile to run 'arq' -->
    </properties>

    <repositories>
        <repository>
            <id>jboss-public-releases-repository-group</id>
            <name>JBoss Public Releases Maven Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
        </repository>
        <repository>
            <id>repo.eclipse.org-snapshots</id>
            <name>Eclipse MicroProfile Repository - Snapshots</name>
            <url>https://repo.eclipse.org/content/repositories/microprofile-snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${version.arquillian}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- for Intellij -->
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-all-7.0</artifactId>
            <version>1.0.3.Final</version>
            <scope>provided</scope>
        </dependency>
        <!-- for testing -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap</groupId>
            <artifactId>shrinkwrap-impl-base</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
              <inherited>false</inherited>
              <groupId>org.sonatype.plugins</groupId>
              <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
		<version>${version.maven-failsafe-plugin}</version>
                <configuration>
                    <redirectTestOutputToFile>${test.logs.to.file}</redirectTestOutputToFile>
                    <skipITs>${skipITs}</skipITs>
                    <systemProperties>
                        <arquillian.xml>arquillian-thorntail.xml</arquillian.xml>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Running only integration tests with failsafe plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
           </plugin>
        </plugins>
    </build>

    <modules>
        <module>lra-service-base</module>
        <module>lra-client</module>
        <module>lra-coordinator</module>
        <module>lra-proxy</module>
        <module>lra-annotation-checker</module>
        <module>lra-test</module>
        <module>narayana-lra</module>
    </modules>

    <profiles>
      <profile>
          <!-- profile to tests starting a server runtime aka. using Arquillian - for example TCK ones-->
          <id>arq</id>
          <activation>
              <activeByDefault>false</activeByDefault>
          </activation>
          <properties>
              <skipITs>false</skipITs>
          </properties>
      </profile>

      <profile>
          <id>j9</id>
          <activation>
             <jdk>[1.9,11)</jdk>
          </activation>
          <build>
            <plugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                  <execution>
                    <id>default-compile</id>
                    <configuration>
                      <showDeprecation>false</showDeprecation>
                      <compilerArgs>
                        <arg>--add-modules</arg>
                        <arg>java.xml.bind</arg>
                      </compilerArgs>
                    </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>
                  <executions>
                    <execution>
                      <id>default-install</id>
                      <phase>install</phase>
                    </execution>
                  </executions>
                  <inherited>false</inherited>
                </plugin>
              </plugins>
          </build>
      </profile>
    </profiles>
</project>
