<?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>
    <parent>
        <groupId>com.github.martinpaljak</groupId>
        <artifactId>javacard</artifactId>
        <version>19.05.08</version>
    </parent>
    <artifactId>ant-javacard</artifactId>
    <version>19.05.08</version>
    <description>Easy to use Ant task for building JavaCard applets</description>
    <name>ant-javacard</name>
    <url>https://github.com/martinpaljak/ant-javacard</url>
    <dependencies>
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.8.2</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <!-- Ant and build.xml use Maven dependecy in a hacky way. Change build.xml as well -->
        <dependency>
            <groupId>com.github.martinpaljak</groupId>
            <artifactId>capfile</artifactId>
            <version>19.03.04</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- Package -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <finalName>ant-javacard</finalName>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>pro.javacard.ant.DummyMain</mainClass>
                                </transformer>
                            </transformers>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/maven/**</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Reproducible -->
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>retrieve-git-info</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <injectAllReactorProjects>true</injectAllReactorProjects>
                    <runOnlyOnce>true</runOnlyOnce>
                    <skipPoms>false</skipPoms>
                    <dateFormat>yyyyMMddHHmmss</dateFormat>
                    <dateFormatTimeZone>UTC</dateFormatTimeZone>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.1</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.9</version>
                <executions>
                    <execution>
                        <id>strip-jar</id>
                        <goals>
                            <goal>strip-jar</goal>
                        </goals>
                        <configuration>
                            <zipDateTime>${git.commit.time}</zipDateTime>
                        </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>
</project>
