<?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>
    <packaging>pom</packaging>
    <groupId>pro.javacard</groupId>
    <artifactId>ant-javacard-package</artifactId>
    <version>26.11.25</version>
    <description>Easy to use Ant task for building JavaCard applets</description>
    <name>ant-javacard package</name>
    <url>https://github.com/martinpaljak/ant-javacard</url>
    <properties>
        <project.build.outputTimestamp>2026-11-25T13:43:29Z</project.build.outputTimestamp>
    </properties>
    <repositories>
        <repository>
            <id>javacard-pro</id>
            <name>javacard.pro</name>
            <url>https://mvn.javacard.pro/public/</url>
        </repository>
        <repository>
            <id>javacard-pro-snapshots</id>
            <url>https://mvn.javacard.pro/public-snapshots/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>javacard-pro</id>
            <url>https://mvn.javacard.pro/public/</url>
        </pluginRepository>
    </pluginRepositories>
    <!-- Default is publishing to private Maven repo on javacard.pro -->
    <distributionManagement>
        <repository>
            <id>javacard-pro</id>
            <url>m2ssh://mvn@mvn.javacard.pro</url>
        </repository>
    </distributionManagement>
    <modules>
        <module>reproducible-zip</module>
        <module>capfile</module>
        <module>javacard-sdk</module>
        <module>task</module>
    </modules>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant</artifactId>
                <version>1.10.18</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>7.12.0</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.20</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>2.0.20</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <defaultGoal>clean verify</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.7.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.16.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.6.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.22.0</version>
                </plugin>
                <plugin>
                    <groupId>org.openrewrite.maven</groupId>
                    <artifactId>rewrite-maven-plugin</artifactId>
                    <version>6.46.1</version>
                    <configuration>
                        <runPerSubmodule>true</runPerSubmodule>
                        <skipMavenParsing>true</skipMavenParsing>
                        <activeRecipes>
                            <!-- Braces everywhere -->
                            <recipe>org.openrewrite.staticanalysis.NeedBraces</recipe>
                            <!-- Standard modifier ordering -->
                            <recipe>org.openrewrite.staticanalysis.ModifierOrder</recipe>
                            <!-- Final everywhere -->
                            <recipe>org.openrewrite.staticanalysis.FinalizePrivateFields</recipe>
                        </activeRecipes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.openrewrite.recipe</groupId>
                            <artifactId>rewrite-static-analysis</artifactId>
                            <version>2.41.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>4.10.5.0</version>
                    <configuration>
                        <excludeFilterFile>spotbugs.xml</excludeFilterFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.16</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <extensions>
            <extension>
                <groupId>pro.javacard.maven</groupId>
                <artifactId>m2ssh</artifactId>
                <version>26.09.07</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Minimum Maven version. Not really relevant with wrapper -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[11,)</version>
                                    <message>Project requires JDK 11+</message>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>[3.10.2,)</version>
                                </requireMavenVersion>
                                <requirePluginVersions/>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Compiler -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs>
                        <arg>-Werror</arg>
                        <arg>-Xlint:all</arg>
                    </compilerArgs>
                </configuration>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <!-- the jar has to load on 1.8; module-info.java needs 9+ and is compiled separately -->
                            <release>8</release>
                            <excludes>
                                <exclude>module-info.java</exclude>
                            </excludes>
                            <compilerArgs combine.children="append">
                                <!-- release 8 is obsolete on JDK 21+ -->
                                <arg>-Xlint:-options</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Run tests with 11 -->
                        <id>default-testCompile</id>
                        <configuration>
                            <release>11</release>
                            <!-- tests are not part of the module -->
                            <useModulePath>false</useModulePath>
                        </configuration>
                    </execution>
                    <execution>
                        <id>module-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <!-- checked against the classes default-compile just wrote, so the entries are right -->
                        <configuration>
                            <release>11</release>
                            <includes>
                                <include>module-info.java</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>java11-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <release>11</release>
                            <compileSourceRoots>
                                <compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
                            </compileSourceRoots>
                            <multiReleaseOutput>true</multiReleaseOutput>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>ant-dist</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <!-- Pass the plugin classpath to antrun, which is normally not there -->
                                <property name="maven.plugin.classpath" refid="maven.plugin.classpath"/>
                                <ant antfile="build.xml" target="dist" inheritAll="true"/>
                            </target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>ant-test</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <property name="maven.plugin.classpath" refid="maven.plugin.classpath"/>
                                <ant antfile="build.xml" target="test" inheritAll="true"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- Metadata -->
    <licenses>
        <license>
            <name>MIT</name>
            <url>https://github.com/martinpaljak/ant-javacard/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/martinpaljak/ant-javacard</url>
    </scm>
    <profiles>
        <profile>
            <id>check</id>
            <activation>
                <jdk>25</jdk>
                <property>
                    <name>env.CI</name>
                    <value>true</value>
                </property>
                <file>
                    <exists>${basedir}/src/main/java</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>dryRunNoFork</goal>
                                </goals>
                                <configuration>
                                    <failOnDryRunResults>true</failOnDryRunResults>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <activation>
                <property>
                    <name>env.CI</name>
                    <value>true</value>
                </property>
                <file>
                    <exists>${basedir}/src/main/java</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <excludes>
                                        <exclude>pro/javacard/zip/ZIPEntryTime.class</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>fixup</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>runNoFork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
