<?xml version="1.0" encoding="UTF-8"?>
<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>

    <groupId>pro.javacard.maven</groupId>
    <artifactId>m2ssh</artifactId>
    <version>26.09.07</version>
    <name>m2ssh</name>
    <description>The m2ssh scheme for Maven: the wire, a client that speaks it over a spawned command, a resolver transporter and a wagon</description>

    <!-- Written over ssh, read over https. The url names no tree: this key's line in
         authorized_keys says which one a release goes to and which one a snapshot goes to. -->
    <distributionManagement>
        <repository>
            <id>javacard</id>
            <url>m2ssh://mvn@mvn.javacard.pro</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.outputTimestamp>2026-09-07T17:17:45Z</project.build.outputTimestamp>
        <maven.compiler.release>17</maven.compiler.release>
        <resolver.version>1.9.27</resolver.version>
        <wagon.version>3.5.3</wagon.version>
        <maven.version>3.9.16</maven.version>
        <testng.version>7.12.0</testng.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-api</artifactId>
            <version>${resolver.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-spi</artifactId>
            <version>${resolver.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-provider-api</artifactId>
            <version>${wagon.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- Maven resolves a build extension the way it resolves a plugin, so the https side of
         the tree the deploy url writes to over ssh belongs here. -->
    <pluginRepositories>
        <pluginRepository>
            <id>javacard-snapshots</id>
            <url>https://mvn.javacard.pro/public-snapshots/</url>
            <releases><enabled>false</enabled></releases>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <defaultGoal>clean verify</defaultGoal>

        <!-- This project publishes itself with the copy of itself that it published last. The
             version lags on purpose: naming ${project.version} would ask a build to resolve the
             artifact it has not built yet. -->
        <extensions>
            <extension>
                <groupId>pro.javacard.maven</groupId>
                <artifactId>m2ssh</artifactId>
                <version>26.08.28-SNAPSHOT</version>
            </extension>
        </extensions>

        <plugins>
            <!-- Minimum Maven version. Not really relevant with wrapper -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.3</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.16,)</version>
                                </requireMavenVersion>
                                <requirePluginVersions/>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.15</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>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.15.0</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-resources-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-clean-plugin</artifactId>
                    <version>3.5.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-site-plugin</artifactId>
                    <version>3.22.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.6</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </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>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <version>4.10.4.0</version>
                        <executions>
                            <execution>
                                <id>spotbugs</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <excludeFilterFile>${project.basedir}/spotbugs.xml</excludeFilterFile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
