<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright The Narayana Authors
   SPDX short identifier: Apache-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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.jboss.narayana</groupId>
    <artifactId>narayana-all</artifactId>
    <version>7.3.3.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>common</artifactId>
  <packaging>jar</packaging>
  <name>Narayana: common</name>
  <description>Narayana: common</description>
  <properties>
    <checkstyle.skip>true</checkstyle.skip>
    <propertiesFileName>jbossts-properties.xml</propertiesFileName>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss.narayana</groupId>
        <artifactId>main-dependency-management</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.narayana</groupId>
        <artifactId>test-dependency-management</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging-annotations</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <!-- START TEST -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- END TEST -->
  </dependencies>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>${project.basedir}/src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <!-- Adding annotationProcessor to add generated logger implementations to compiler -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <annotationProcessorPaths>
            <path>
              <groupId>org.jboss.logging</groupId>
              <artifactId>jboss-logging-processor</artifactId>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
    </plugins>
    <sourceDirectory>classes</sourceDirectory>
    <testSourceDirectory>tests</testSourceDirectory>
  </build>
  <profiles>
    <profile>
      <id>testing</id>
      <activation>
        <property>
          <name>!release</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
              <archive>
                <manifestEntries>
                  <arjuna-properties-file>jbossts-properties.xml</arjuna-properties-file>
                </manifestEntries>
              </archive>
            </configuration>
            <executions>
              <execution>
                <id>create-test-jar</id>
                <goals>
                  <goal>test-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-test-sources</id>
                <goals>
                  <goal>test-jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/DummyProperties.java</exclude>
                <exclude>**/DummyEnvironmentBean.java</exclude>
              </excludes>
              <systemPropertyVariables>
                <test_build_version>${buildNumber}</test_build_version>
                <test_build_prop_file>${propertiesFileName}</test_build_prop_file>
                <test_build_id>JBoss Inc. [${user.name}] ${os.name} ${os.version} ${buildproperty.date}</test_build_id>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
