<?xml version="1.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.eclipse.ee4j</groupId>
        <artifactId>project</artifactId>
        <version>1.0.9</version>
    </parent>

    <groupId>jakarta.tck</groupId>
    <artifactId>sigtest-maven-plugin</artifactId>
    <version>2.2</version>
    <packaging>maven-plugin</packaging>
    <name>API Signature Test Plugin</name>
    <url>https://github.com/eclipse-ee4j/jakartaee-tck-tools/wiki</url>
    <description>
        Signature test to compare APIs of two versions of JARs
        of the same library.
    </description>

    <scm>
        <connection>scm:git:https://github.com/eclipse-ee4j/jakartaee-tck-tools</connection>
        <developerConnection>scm:git:https://github.com/eclipse-ee4j/jakartaee-tck-tools</developerConnection>
        <url>https://github.com/eclipse-ee4j/jakartaee-tck-tools/tools/sigtest</url>
        <tag>master</tag>
    </scm>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <ct.sym>${java.home}/lib/ct.sym</ct.sym>

        <maven.compiler.release>11</maven.compiler.release>
        <!-- Require a Java 17 for testing and compiling -->
        <maven.compiler.testRelease>17</maven.compiler.testRelease>
        <jdk.min.version>${maven.compiler.testRelease}</jdk.min.version>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-java-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <message>To build this project JDK ${jdk.min.version} (or greater) is required.</message>
                                    <version>${jdk.min.version}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Xlint:deprecation</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeGroupIds>org.netbeans.tools</includeGroupIds>
                            <includes>**/*</includes>
                            <excludes>META-INF/**</excludes>
                            <outputDirectory>${project.build.directory}/classes/META-INF/sigtest/</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.5</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.2.5</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>report-only</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <id>list-sigtest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>org.netbeans.apitest.ListCtSym</mainClass>
                            <arguments>
                                <argument>${project.build.directory}/classes/META-INF/sigtest.ls</argument>
                                <argument>${project.build.directory}/classes/META-INF/sigtest/</argument>
                                <argument>2</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <configuration>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                    <subpackages>org.netbeans.apitest</subpackages>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <extractors>
                        <extractor>java-annotations</extractor>
                    </extractors>
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.9.6</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.11.0</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.9.6</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.10.14</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-nbjunit</artifactId>
            <version>RELEASE200</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-junit</artifactId>
            <version>1.10.14</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-compat</artifactId>
            <version>3.9.6</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.netbeans.tools</groupId>
            <artifactId>ct-sym</artifactId>
            <version>latest</version>
            <scope>system</scope>
            <systemPath>${ct.sym}</systemPath>
            <type>jar</type>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-release-plugin</artifactId>
                        <inherited>true</inherited>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <pushChanges>false</pushChanges>
                            <localCheckout>true</localCheckout>
                            <preparationGoals>clean install</preparationGoals>
                            <releaseProfiles>gpg-sign,jboss-release</releaseProfiles>
                            <tagNameFormat>@{project.version}</tagNameFormat>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <doclet>nl.talsmasoftware.umldoclet.UMLDoclet</doclet>
                            <docletArtifact>
                                <groupId>nl.talsmasoftware</groupId>
                                <artifactId>umldoclet</artifactId>
                                <version>2.0.18</version>
                            </docletArtifact>
                            <useStandardDocletOptions>true</useStandardDocletOptions>
                            <charset>UTF-8</charset>
                            <encoding>UTF-8</encoding>
                            <docencoding>UTF-8</docencoding>
                            <breakiterator>true</breakiterator>
                            <version>true</version>
                            <author>true</author>
                            <keywords>true</keywords>
                            <additionalOptions>
                                <additionalOption>-sourceclasspath ${project.build.outputDirectory}</additionalOption>
                            </additionalOptions>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <distributionManagement>
                <repository>
                    <id>${jboss.releases.repo.id}</id>
                    <name>JBoss Releases Repository</name>
                    <url>${jboss.releases.repo.url}</url>
                </repository>
                <snapshotRepository>
                    <id>${jboss.snapshots.repo.id}</id>
                    <name>JBoss Snapshots Repository</name>
                    <url>${jboss.snapshots.repo.url}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
    </profiles>

</project>
