<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2022, 2025 Contributors to Eclipse Foundation.
    Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.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>

    <groupId>jakarta.security.tck</groupId>
    <artifactId>security-siggen</artifactId>
    <version>4.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Security TCK Signature Generation</name>
    <description>
        This module is used by the TCK maintainers to generate a new version of the API signature file from a well known
        good artefact. It does not have to be used for running the tests against a Jakarta Security implementation.
        
        The sig file generated by this module will be copied to ../security-signaturetest 
    </description>

    <properties>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <sigtest.plugin.version>2.6</sigtest.plugin.version>
        <junit.jupiter.version>5.10.2</junit.jupiter.version>
        <security.api.version>4.0.1-SNAPSHOT</security.api.version>
        <servlet.api.version>6.1.0</servlet.api.version>
    </properties>

    <repositories>
        <repository>
            <id>jakarta-staging</id>
            <snapshots />
            <url>https://jakarta.oss.sonatype.org/content/repositories/staging</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.4.1</version>
                <configuration>
                    <rules>
                        <requireMavenVersion>
                            <version>3.8.6</version>
                        </requireMavenVersion>
                        <requireJavaVersion>
                            <version>17</version>
                        </requireJavaVersion>
                    </rules>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>jakarta.security.enterprise</groupId>
                                    <artifactId>jakarta.security.enterprise-api</artifactId>
                                    <version>${security.api.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <destFileName>jakarta.security.enterprise-api.jar</destFileName>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>jakarta.inject</groupId>
                                    <artifactId>jakarta.inject-api</artifactId>
                                    <version>2.0.1.MR</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/</outputDirectory>
                                    <destFileName>jakarta.inject-api.jar</destFileName>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>jakarta.interceptor</groupId>
                                    <artifactId>jakarta.interceptor-api</artifactId>
                                    <version>2.2.0</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/</outputDirectory>
                                    <destFileName>jakarta.interceptor-api.jar</destFileName>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>jakarta.enterprise</groupId>
                                    <artifactId>jakarta.enterprise.cdi-api</artifactId>
                                    <version>4.1.0</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/</outputDirectory>
                                    <destFileName>jakarta.enterprise.cdi-api.jar</destFileName>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>jakarta.servlet</groupId>
                                    <artifactId>jakarta.servlet-api</artifactId>
                                    <version>6.1.0</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/</outputDirectory>
                                    <destFileName>jakarta.servlet-api.jar</destFileName>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>jakarta.authentication</groupId>
                                    <artifactId>jakarta.authentication-api</artifactId>
                                    <version>3.1.0</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/</outputDirectory>
                                    <destFileName>jakarta.authentication-api.jar</destFileName>
                                </artifactItem>
                                
                                <artifactItem>
                                    <groupId>jakarta.json</groupId>
                                    <artifactId>jakarta.json-api</artifactId>
                                    <version>2.1.3</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/</outputDirectory>
                                    <destFileName>jakarta.json-api.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>jakarta.tck</groupId>
                <artifactId>sigtest-maven-plugin</artifactId>
                <version>${sigtest.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sigfile>${project.build.directory}/jakarta.security.enterprise.sig_${project.version}</sigfile>
                    <packages>jakarta.security.enterprise,jakarta.security.enterprise.authentication.mechanism.http,jakarta.security.enterprise.authentication.mechanism.http.openid,jakarta.security.enterprise.credential,jakarta.security.enterprise.identitystore,jakarta.security.enterprise.identitystore.openid</packages>
                    <classes>${project.build.directory}</classes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
