<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.github.martinpaljak</groupId>
    <version>26.04.20</version>
    <artifactId>gppro</artifactId>
    <packaging>pom</packaging>
    <name>GlobalPlatformPro</name>
    <url>https://github.com/martinpaljak/GlobalPlatformPro</url>
    <description>Manage applets and keys on JavaCard-s like a pro</description>
    <inceptionYear>2013</inceptionYear>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <project.build.outputTimestamp>2026-04-20T05:38:21Z</project.build.outputTimestamp>
        <apdu4j.version>26.04.20.1</apdu4j.version>
    </properties>
    <organization>
        <name>Martin Paljak and contributors</name>
        <url>https://javacard.pro/globalplatformpro</url>
    </organization>
    <licenses>
        <license>
            <name>LGPL-3.0</name>
            <url>https://github.com/martinpaljak/GlobalPlatformPro/blob/master/LICENSE</url>
            <distribution>repo</distribution>
            <comments>Some files under MIT</comments>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/martinpaljak/GlobalPlatformPro</url>
        <developerConnection>scm:git:git@github.com:martinpaljak/globalplatformpro.git</developerConnection>
    </scm>
    <!-- Always pick up private deps -->
    <repositories>
        <repository>
            <id>javacard-pro</id>
            <url>https://mvn.javacard.pro/maven/</url>
        </repository>
        <repository>
            <id>javacard-pro-snapshots</id>
            <url>https://mvn.javacard.pro/maven/SNAPSHOTS/</url>
        </repository>
    </repositories>
    <modules>
        <module>tlv</module>
        <module>library</module>
        <module>pace</module>
        <module>tool</module>
    </modules>
    <build>
        <defaultGoal>clean verify</defaultGoal>
        <plugins>
            <!-- Minimum Maven version. Not really relevant with wrapper -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.2</version>
                <executions>
                    <execution>
                        <id>enforce-maven-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[17,)</version>
                                    <message>Project requires JDK 17+</message>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>[3.9.15,)</version>
                                </requireMavenVersion>
                                <requirePluginVersions/>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.15.0</version>
                <configuration>
                    <release>17</release>
                    <compilerArgs>
                        <arg>-Werror</arg>
                        <arg>-Xlint:all</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <!-- Bundle sources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>install</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <java>
                        <excludes>
                            <exclude>**/module-info.java</exclude>
                        </excludes>
                        <eclipse>
                            <file>${maven.multiModuleProjectDirectory}/eclipse-formatter.xml</file>
                        </eclipse>
                        <toggleOffOn/>
                    </java>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.14</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <!-- Version fixes for enforcer -->
        <pluginManagement>
            <plugins>
                <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-install-plugin</artifactId>
                    <version>3.1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.21.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-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.openrewrite.maven</groupId>
                    <artifactId>rewrite-maven-plugin</artifactId>
                    <version>6.36.0</version>
                    <configuration>
                        <activeRecipes>
                            <!-- Control flow -->
                            <recipe>org.openrewrite.staticanalysis.NeedBraces</recipe>
                            <recipe>org.openrewrite.staticanalysis.EmptyBlock</recipe>
                            <recipe>org.openrewrite.staticanalysis.FallThrough</recipe>
                            <recipe>org.openrewrite.staticanalysis.DefaultComesLast</recipe>
                            <!-- Equality and comparison -->
                            <recipe>org.openrewrite.staticanalysis.EqualsAvoidsNull</recipe>
                            <recipe>org.openrewrite.staticanalysis.StringLiteralEquality</recipe>
                            <recipe>org.openrewrite.staticanalysis.IndexOfReplaceableByContains</recipe>
                            <recipe>org.openrewrite.staticanalysis.IndexOfShouldNotCompareGreaterThanZero</recipe>
                            <recipe>org.openrewrite.staticanalysis.CovariantEquals</recipe>
                            <recipe>org.openrewrite.staticanalysis.RenameMethodsNamedHashcodeEqualOrToString</recipe>
                            <!-- Modifier correctness -->
                            <recipe>org.openrewrite.staticanalysis.ModifierOrder</recipe>
                            <recipe>org.openrewrite.staticanalysis.FinalClass</recipe>
                            <recipe>org.openrewrite.staticanalysis.StaticMethodNotFinal</recipe>
                            <recipe>org.openrewrite.staticanalysis.NestedEnumsAreNotStatic</recipe>
                            <!-- Declarations and scope -->
                            <!--<recipe>org.openrewrite.staticanalysis.HiddenField</recipe>-->
                            <recipe>org.openrewrite.staticanalysis.MultipleVariableDeclarations</recipe>
                            <!-- Dead code and redundancy -->
                            <recipe>org.openrewrite.staticanalysis.NoRedundantJumpStatements</recipe>
                            <recipe>org.openrewrite.staticanalysis.RemoveExtraSemicolons</recipe>
                            <recipe>org.openrewrite.staticanalysis.UnnecessaryParentheses</recipe>
                            <recipe>org.openrewrite.staticanalysis.NoToStringOnStringType</recipe>
                            <recipe>org.openrewrite.staticanalysis.NoValueOfOnStringType</recipe>
                            <!--<recipe>org.openrewrite.staticanalysis.RemoveUnneededBlock</recipe>-->
                            <!--<recipe>org.openrewrite.staticanalysis.IsEmptyCallOnCollections</recipe>-->
                            <!-- Boolean and control flow simplification -->
                            <recipe>org.openrewrite.staticanalysis.SimplifyBooleanReturn</recipe>
                            <recipe>org.openrewrite.staticanalysis.BooleanChecksNotInverted</recipe>
                            <!--<recipe>org.openrewrite.staticanalysis.SimplifyBooleanExpression</recipe>-->
                            <!--<recipe>org.openrewrite.staticanalysis.SimplifyConstantIfBranchExecution</recipe>-->
                            <!-- Type safety and modern Java -->
                            <recipe>org.openrewrite.staticanalysis.UseDiamondOperator</recipe>
                            <recipe>org.openrewrite.staticanalysis.RemoveRedundantTypeCast</recipe>
                            <recipe>org.openrewrite.staticanalysis.InstanceOfPatternMatch</recipe>
                            <recipe>org.openrewrite.staticanalysis.UseJavaStyleArrayDeclarations</recipe>
                            <recipe>org.openrewrite.staticanalysis.PrimitiveWrapperClassConstructorToValueOf</recipe>
                            <recipe>org.openrewrite.staticanalysis.MissingOverrideAnnotation</recipe>
                            <recipe>org.openrewrite.staticanalysis.ReplaceClassIsInstanceWithInstanceof</recipe>
                            <!-- String handling -->
                            <recipe>org.openrewrite.staticanalysis.UseStringReplace</recipe>
                            <recipe>org.openrewrite.staticanalysis.ReplaceStringBuilderWithString</recipe>
                            <recipe>org.openrewrite.staticanalysis.CaseInsensitiveComparisonsDoNotChangeCase</recipe>
                            <!--<recipe>org.openrewrite.staticanalysis.ChainStringBuilderAppendCalls</recipe>-->
                            <!--<recipe>org.openrewrite.staticanalysis.UpperCaseLiteralSuffixes</recipe>-->
                            <!-- Exception and resource handling -->
                            <recipe>org.openrewrite.staticanalysis.CatchClauseOnlyRethrows</recipe>
                            <recipe>org.openrewrite.staticanalysis.CombineSemanticallyEqualCatchBlocks</recipe>
                            <recipe>org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources</recipe>
                            <!--<recipe>org.openrewrite.staticanalysis.UnnecessaryThrows</recipe>-->
                            <!-- Serialization safety -->
                            <recipe>org.openrewrite.staticanalysis.NoFinalizer</recipe>
                            <recipe>org.openrewrite.staticanalysis.NoDoubleBraceInitialization</recipe>
                            <!-- Threading -->
                            <recipe>org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart</recipe>
                            <!-- Naming -->
                            <recipe>org.openrewrite.staticanalysis.RenameExceptionInEmptyCatch</recipe>
                            <!-- Modern Java -->
                            <recipe>org.openrewrite.staticanalysis.UseStandardCharset</recipe>
                            <recipe>org.openrewrite.java.migrate.lang.UseVar</recipe>
                            <recipe>org.openrewrite.java.migrate.lang.var.UseVarForTypeCast</recipe>
                            <recipe>org.openrewrite.java.migrate.lang.StringFormatted</recipe>
                            <recipe>org.openrewrite.java.RemoveUnusedImports</recipe>
                        </activeRecipes>
                        <failOnDryRunResults>true</failOnDryRunResults>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.openrewrite.recipe</groupId>
                            <artifactId>rewrite-static-analysis</artifactId>
                            <version>2.32.0</version>
                        </dependency>
                        <dependency>
                            <groupId>org.openrewrite.recipe</groupId>
                            <artifactId>rewrite-migrate-java</artifactId>
                            <version>3.32.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.github.martinpaljak</groupId>
                <artifactId>apdu4j-core</artifactId>
                <version>${apdu4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.martinpaljak</groupId>
                <artifactId>apdu4j-prefs</artifactId>
                <version>${apdu4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.martinpaljak</groupId>
                <artifactId>apdu4j-pcsc</artifactId>
                <version>${apdu4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.martinpaljak</groupId>
                <artifactId>apdu4j-apdulette</artifactId>
                <version>${apdu4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.17</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>2.0.17</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcpkix-jdk18on</artifactId>
                <version>1.84</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>7.12.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <profiles>
        <profile>
            <id>jdk21</id>
            <activation>
                <jdk>[21,)</jdk>
            </activation>
            <modules>
                <module>nextgen</module>
            </modules>
        </profile>
        <profile>
            <id>ide</id>
            <activation>
                <file>
                    <exists>${basedir}/apdu4j/pom.xml</exists>
                </file>
            </activation>
            <modules>
                <module>apdu4j</module>
            </modules>
        </profile>
        <profile>
            <id>fixup</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>rewrite-fixup</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>check</id>
            <activation>
                <jdk>[21,)</jdk>
                <property>
                    <name>env.CI</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <version>4.9.8.3</version>
                        <executions>
                            <execution>
                                <id>parent-spotbugs</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <excludeFilterFile>spotbugs.xml</excludeFilterFile>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <fork>true</fork>
                            <compilerArgs>
                                <arg>-Xlint:all</arg>
                                <arg>-XDcompilePolicy=simple</arg>
                                <arg>--should-stop=ifError=FLOW</arg>
                                <arg>-Xplugin:ErrorProne -Xep:ArrayRecordComponent:OFF -Xep:ImmutableEnumChecker:OFF</arg>
                                <arg>-XDaddTypeAnnotationsToSymbol=true</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
                                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
                            </compilerArgs>
                            <annotationProcessorPaths combine.children="append">
                                <path>
                                    <groupId>com.google.errorprone</groupId>
                                    <artifactId>error_prone_core</artifactId>
                                    <version>2.49.0</version>
                                </path>
                            </annotationProcessorPaths>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>rewrite-check</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>dryRun</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
