<?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>metacard</artifactId>
    <packaging>pom</packaging>
    <version>20.08.07</version>
    <name>Martin's JavaCard projects</name>
    <url>https://github.com/martinpaljak/metacard</url>
    <description>Parent project for JavaCard projects</description>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.wagon.http.retryHandler.count>2</maven.wagon.http.retryHandler.count>
    </properties>
    <scm>
        <url>https://github.com/martinpaljak/metacard</url>
        <developerConnection>scm:git:git@github.com:martinpaljak/metacard.git</developerConnection>
    </scm>
    <licenses>
        <license>
            <name>MIT</name>
            <url>https://github.com/martinpaljak/metacard/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <!-- Default is publishing to private Maven repo -->
    <distributionManagement>
        <repository>
            <id>javacard</id>
            <url>scpexe://mvn@javacard.pro/home/mvn/maven/</url>
        </repository>
    </distributionManagement>
    <repositories>
        <repository>
            <id>javacard-pro</id>
            <url>https://javacard.pro/maven/</url>
        </repository>
    </repositories>
    <!-- Universal dependencies for we always run findbugs -->
    <dependencies>
        <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-annotations</artifactId>
            <version>4.1.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>release</id>
            <!--  Deploy to Maven central -->
            <distributionManagement>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh-martinpaljak</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>3.4.1</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <!-- Compiler -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <compilerArgs>
                            <arg>-Xlint</arg>
                            <arg>-Werror</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <!-- If any JavaDoc, it better be very precise -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.2.0</version>
                    <configuration>
                        <failOnWarnings>true</failOnWarnings>
                        <source>8</source>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>verify-javadoc</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>javadoc-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Reproducible -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Last-Commit-Id>${git.commit.id}</Last-Commit-Id>
                                <Last-Commit-Time>${git.commit.time}</Last-Commit-Time>
                                <Reproducible-Build>true</Reproducible-Build>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.github.zlika</groupId>
                    <artifactId>reproducible-build-maven-plugin</artifactId>
                    <version>0.12</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <id>strip-jar</id>
                            <goals>
                                <goal>strip-jar</goal>
                            </goals>
                            <configuration>
                                <zipDateTime>${git.commit.time}</zipDateTime>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- Minimum Maven version -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.3</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Mangle version for Windows, to have no leading '0' -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>windows-file-version</id>
                        <goals>
                            <goal>parse-version</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Spotbugs -->
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>4.0.4</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Reproducible -->
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>4.0.1</version>
                <executions>
                    <execution>
                        <id>retrieve-git-info</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <injectAllReactorProjects>true</injectAllReactorProjects>
                    <runOnlyOnce>true</runOnlyOnce>
                    <offline>true</offline>
                    <skipPoms>false</skipPoms>
                    <dateFormat>yyyyMMddHHmmss</dateFormat>
                    <dateFormatTimeZone>UTC</dateFormatTimeZone>
                </configuration>
            </plugin>
            <!-- Version fixes -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0-M1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.9.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <tagListOptions>
                        <tagClasses>
                            <tagClass>
                                <displayName>Todo Work</displayName>
                                <tags>
                                    <tag>
                                        <matchString>todo</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                    <tag>
                                        <matchString>FIXME</matchString>
                                        <matchType>exact</matchType>
                                    </tag>
                                    <tag>
                                        <matchString>XXX</matchString>
                                        <matchType>exact</matchType>
                                    </tag>
                                </tags>
                            </tagClass>
                        </tagClasses>
                    </tagListOptions>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
    <developers>
        <developer>
            <id>martinpaljak</id>
            <name>Martin Paljak</name>
            <email>martin@martinpaljak.net</email>
            <url>https://github.com/martinpaljak</url>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>
</project>
