<?xml version="1.0" encoding="UTF-8"?>
<!--

   Copyright The Narayana Authors

   SPDX-License-Identifier: LGPL-2.1-only

-->
<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>5.13.1.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>jbosstxbridge-jakarta</artifactId>
  <packaging>jar</packaging>
  <name>Narayana: txbridge-jakarta</name>
  <description>Narayana: txbridge-jakarta</description>

  <properties>
    <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
    <sortpom.skip>false</sortpom.skip>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.jboss.narayana</groupId>
      <artifactId>jbosstxbridge</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.eclipse.transformer</groupId>
            <artifactId>org.eclipse.transformer.cli</artifactId>
            <version>${version.org.eclipse.transformer}</version>
          </dependency>
          <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>${version.ant-contrib}</version>
            <exclusions>
              <exclusion>
                <groupId>ant</groupId>
                <artifactId>ant</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.jboss.narayana</groupId>
            <artifactId>jbosstxbridge</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>transform-jar</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <target>
                <property name="plugin_classpath" refid="maven.plugin.classpath"></property>
                <java classname="org.eclipse.transformer.jakarta.JakartaTransformer">
                  <arg value="${org.jboss.narayana:jbosstxbridge:jar}"></arg>
                  <arg value="${project.build.directory}/${project.build.finalName}.jar"></arg>
                  <arg value="-q"></arg>
                  <arg value="-o"></arg>
                  <arg value="-tr"></arg>
                  <arg value="${project.basedir}/../jakarta-rules/jakarta-renames.properties"></arg>
                  <arg value="-td"></arg>
                  <arg value="${project.basedir}/../jakarta-rules/jakarta-direct.properties"></arg>
                  <classpath>
                    <pathelement path="${plugin_classpath}"></pathelement>
                  </classpath>
                </java>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>transform-sources-jar</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <target>
                <property name="plugin_classpath" refid="maven.plugin.classpath"></property>
                <ac:propertyregex xmlns:ac="antlib:net.sf.antcontrib" global="true" input="${org.jboss.narayana:jbosstxbridge:jar}" property="source" regexp="\.jar$" replace="-sources.jar"></ac:propertyregex>
                <java classname="org.eclipse.transformer.jakarta.JakartaTransformer">
                  <arg value="${source}"></arg>
                  <arg value="${project.build.directory}/${project.build.finalName}-sources.jar"></arg>
                  <arg value="-q"></arg>
                  <arg value="-o"></arg>
                  <arg value="-tr"></arg>
                  <arg value="${project.basedir}/../jakarta-rules/jakarta-renames.properties"></arg>
                  <arg value="-td"></arg>
                  <arg value="${project.basedir}/../jakarta-rules/jakarta-direct.properties"></arg>
                  <classpath>
                    <pathelement path="${plugin_classpath}"></pathelement>
                  </classpath>
                </java>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>transform-javadoc</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <target>
                <property name="plugin_classpath" refid="maven.plugin.classpath"></property>
                <ac:propertyregex xmlns:ac="antlib:net.sf.antcontrib" global="true" input="${org.jboss.narayana:jbosstxbridge:jar}" property="source" regexp="\.jar$" replace="-javadoc.jar"></ac:propertyregex>
                <java classname="org.eclipse.transformer.jakarta.JakartaTransformer">
                  <arg value="${source}"></arg>
                  <arg value="${project.build.directory}/${project.build.finalName}-javadoc.jar"></arg>
                  <arg value="-q"></arg>
                  <arg value="-o"></arg>
                  <arg value="-tr"></arg>
                  <arg value="${project.basedir}/../jakarta-rules/jakarta-renames.properties"></arg>
                  <arg value="-td"></arg>
                  <arg value="${project.basedir}/../jakarta-rules/jakarta-direct.properties"></arg>
                  <classpath>
                    <pathelement path="${plugin_classpath}"></pathelement>
                  </classpath>
                </java>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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-install-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>default-install</id>
                <phase>install</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>sources</id>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/${project.artifactId}-${project.version}-sources.jar</file>
                      <type>jar</type>
                      <classifier>sources</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
              <execution>
                <id>javadoc</id>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar</file>
                      <type>jar</type>
                      <classifier>javadoc</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
