<?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>

    <parent>
        <groupId>pro.javacard</groupId>
        <artifactId>beefy-parent</artifactId>
        <version>26.06.29</version>
    </parent>

    <artifactId>beefy-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <name>Beefy Maven Plugin</name>
    <description>Maven plugin for creating self-installing fat JARs with bundled dependencies and source</description>

    <properties>
        <maven.version>3.9.16</maven.version>
    </properties>

    <dependencies>
        <!-- Maven Plugin API -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</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.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.15.2</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>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- BeefyBoot + BeefySig for the wrap goal -->
        <dependency>
            <groupId>pro.javacard</groupId>
            <artifactId>beefy-sshsig-jar</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!-- BeefySourcePackager for the source goal -->
        <dependency>
            <groupId>pro.javacard</groupId>
            <artifactId>beefy-source-jar</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!-- AtomicFiles for the wrap goal -->
        <dependency>
            <groupId>pro.javacard</groupId>
            <artifactId>beefy-common</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.15.2</version>
                <executions>
                    <execution>
                        <id>default-descriptor</id>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <settingsFile>src/it/settings.xml</settingsFile>
                    <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                    <postBuildHookScript>verify</postBuildHookScript>
                    <goals>
                        <goal>clean</goal>
                        <goal>package</goal>
                    </goals>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
