<?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>
    <artifactId>apdu4j</artifactId>
    <version>26.04.20</version>
    <packaging>pom</packaging>
    <name>apdu4j</name>
    <url>https://github.com/martinpaljak/apdu4j</url>
    <description>Working with smart card readers? This is for you.</description>
    <inceptionYear>2015</inceptionYear>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <project.build.outputTimestamp>2026-04-20T04:43:11Z</project.build.outputTimestamp>
    </properties>
    <scm>
        <url>https://github.com/martinpaljak/apdu4j</url>
        <developerConnection>scm:git:git@github.com:martinpaljak/apdu4j.git</developerConnection>
    </scm>
    <repositories>
        <!-- For picking up latest apdu4j-jnasmartcardio -->
        <repository>
            <id>javacard-pro</id>
            <name>javacard.pro</name>
            <url>https://mvn.javacard.pro/maven/</url>
        </repository>
        <repository>
            <id>javacard-pro-snapshots</id>
            <name>javacard.pro</name>
            <url>https://mvn.javacard.pro/maven/SNAPSHOTS/</url>
        </repository>
    </repositories>
    <organization>
        <name>Martin Paljak</name>
    </organization>
    <licenses>
        <license>
            <name>MIT</name>
            <url>https://github.com/martinpaljak/apdu4j/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <modules>
        <module>prefs</module>
        <module>core</module>
        <module>pcsc-sim</module>
        <module>pcsc</module>
        <module>report</module>
    </modules>
    <dependencyManagement>
        <dependencies>
            <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.testng</groupId>
                <artifactId>testng</artifactId>
                <version>7.12.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <defaultGoal>clean verify</defaultGoal>
        <pluginManagement>
            <!-- Version fixes for enforcer -->
            <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-resources-plugin</artifactId>
                    <version>3.5.0</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>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </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-deploy-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.openrewrite.maven</groupId>
                    <artifactId>rewrite-maven-plugin</artifactId>
                    <version>6.35.0</version>
                    <configuration>
                        <activeRecipes>
                            <!-- Control flow / style -->
                            <recipe>org.openrewrite.staticanalysis.NeedBraces</recipe>
                            <recipe>org.openrewrite.staticanalysis.EmptyBlock</recipe>
                            <recipe>org.openrewrite.staticanalysis.FallThrough</recipe>
                            <recipe>org.openrewrite.staticanalysis.DefaultComesLast</recipe>
                            <recipe>org.openrewrite.staticanalysis.ModifierOrder</recipe>
                            <recipe>org.openrewrite.staticanalysis.MultipleVariableDeclarations</recipe>
                            <!-- Type safety / modernization -->
                            <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.MissingOverrideAnnotation</recipe>
                            <recipe>org.openrewrite.staticanalysis.ReplaceClassIsInstanceWithInstanceof</recipe>
                            <!-- Dead code / 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>
                            <!-- Strings / equality -->
                            <recipe>org.openrewrite.staticanalysis.EqualsAvoidsNull</recipe>
                            <recipe>org.openrewrite.staticanalysis.StringLiteralEquality</recipe>
                            <recipe>org.openrewrite.staticanalysis.UseStringReplace</recipe>
                            <recipe>org.openrewrite.staticanalysis.UseStandardCharset</recipe>
                            <!-- Lambda modernization -->
                            <recipe>org.openrewrite.staticanalysis.LambdaBlockToExpression</recipe>
                            <!-- Switch modernization -->
                            <recipe>org.openrewrite.java.migrate.lang.SwitchExpressionYieldToArrow</recipe>
                            <!-- Var usage (conservative: only when type is visible in RHS) -->
                            <recipe>org.openrewrite.java.migrate.lang.var.UseVarForGenericsConstructors</recipe>
                            <recipe>org.openrewrite.java.migrate.lang.var.UseVarForTypeCast</recipe>
                            <!-- Exception / resource / threading -->
                            <recipe>org.openrewrite.staticanalysis.CatchClauseOnlyRethrows</recipe>
                            <recipe>org.openrewrite.staticanalysis.CombineSemanticallyEqualCatchBlocks</recipe>
                            <recipe>org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources</recipe>
                            <recipe>org.openrewrite.staticanalysis.NoFinalizer</recipe>
                            <recipe>org.openrewrite.staticanalysis.NoDoubleBraceInitialization</recipe>
                            <recipe>org.openrewrite.staticanalysis.ReplaceThreadRunWithThreadStart</recipe>
                            <recipe>org.openrewrite.staticanalysis.RenameExceptionInEmptyCatch</recipe>
                        </activeRecipes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.openrewrite.recipe</groupId>
                            <artifactId>rewrite-static-analysis</artifactId>
                            <version>2.31.0</version>
                        </dependency>
                        <dependency>
                            <groupId>org.openrewrite.recipe</groupId>
                            <artifactId>rewrite-migrate-java</artifactId>
                            <version>3.31.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
        <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.14,)</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>
                </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>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <!-- Static analysis checks (auto-activates in CI) -->
        <profile>
            <id>check</id>
            <activation>
                <property>
                    <name>env.CI</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>dryRun</goal>
                                </goals>
                                <phase>verify</phase>
                                <configuration>
                                    <failOnDryRunResults>true</failOnDryRunResults>
                                    <runPerSubmodule>true</runPerSubmodule>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <version>4.9.8.3</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <excludeFilterFile>spotbugs.xml</excludeFilterFile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- OpenRewrite: apply fixes (bound to process-sources) -->
        <profile>
            <id>fixup</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>process-sources</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- Apdulette depends on modern Java 21 features -->
        <profile>
            <id>jdk21+</id>
            <activation>
                <jdk>[21,)</jdk>
            </activation>
            <modules>
                <module>apdulette</module>
                <module>apdulette-pcsc</module>
                <module>tool</module>
            </modules>
        </profile>
    </profiles>
</project>
