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

    Copyright (c) 2023, 2024 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>

    <parent>
        <groupId>org.glassfish.tyrus</groupId>
        <artifactId>tyrus-project</artifactId>
        <version>2.1.6</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <groupId>org.glassfish.tyrus.tests</groupId>
    <artifactId>tyrus-release-test</artifactId>
    <packaging>jar</packaging>
    <name>Tyrus Release Test</name>

    <description>Tyrus post-release validation tests</description>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.version>3.8.6</maven.version>
        <maven.resolver.version>1.7.3</maven.resolver.version><!-- 1.8.2 does not work-->
        <httpclient.version>4.5.14</httpclient.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkCount>1</forkCount>
                    <reuseForks>false</reuseForks>
                    <enableAssertions>false</enableAssertions>
                    <includes>
                        <include>**/ArchetypesTest</include>
                        <include>**/NoticeFilesTest</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.glassfish.tyrus</groupId>
                <artifactId>tyrus-bom</artifactId>
                <version>${project.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
            <!-- maven-plugin-testing-harness does not work with junit 5 -->
        </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>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-compat</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpclient.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-testing</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>3.3.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-connector-basic</artifactId>
            <version>${maven.resolver.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-transport-http</artifactId>
            <version>${maven.resolver.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.glassfish.tyrus</groupId>
            <artifactId>tyrus-core</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>ReleaseTests</id>
            <activation>
                <property>
                    <name>tyrus.version</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.0.0-M7</version>
                        <configuration>
                            <forkCount>1</forkCount>
                            <reuseForks>false</reuseForks>
                            <enableAssertions>false</enableAssertions>
                            <includes>
                                <include>**/DownloadBomPomDependencies</include>
                                <include>**/*Test</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>org.glassfish.tyrus</groupId>
                        <artifactId>tyrus-bom</artifactId>
                        <version>${tyrus.version}</version>
                        <scope>import</scope>
                        <type>pom</type>
                    </dependency>
                </dependencies>
            </dependencyManagement>
            <properties>
                <tyrus.version>${tyrus.version}</tyrus.version> <!-- Must pass using -Dtyrus.version= -->
            </properties>
        </profile>
    </profiles>
</project>
