<?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>io.quarkus</groupId>
        <artifactId>quarkus-parent</artifactId>
        <version>3.31.1</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

    <groupId>io.quarkus.junit</groupId>
    <artifactId>junit-virtual-threads</artifactId>

    <name>Quarkus - JUnit Extension - Virtual Threads</name>
    <description>Module that allows detecting virtual threads pinning</description>
    <url>https://github.com/quarkusio/quarkus</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <distribution>repo</distribution>
            <url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
        </license>
    </licenses>

    <scm child.scm.connection.inherit.append.path="false"
         child.scm.developerConnection.inherit.append.path="false"
         child.scm.url.inherit.append.path="false">
        <url>https://github.com/quarkusio/quarkus</url>
        <connection>scm:git:git@github.com:quarkusio/quarkus.git</connection>
        <developerConnection>scm:git:git@github.com:quarkusio/quarkus.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <compiler.plugin.version>3.14.1</compiler.plugin.version>
        <enforcer.plugin.version>3.2.1</enforcer.plugin.version>
        <surefire.plugin.version>3.5.4</surefire.plugin.version>
        <jandex.version>3.5.3</jandex.version>
        <smallrye-common.version>2.15.0</smallrye-common.version>

        <junit.version>6.0.2</junit.version>
        <assertj.version>3.27.7</assertj.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.smallrye.common</groupId>
                <artifactId>smallrye-common-bom</artifactId>
                <version>${smallrye-common.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- JUnit dependencies, imported as a BOM -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-testkit</artifactId>
        </dependency>
        <dependency>
            <groupId>io.smallrye.common</groupId>
            <artifactId>smallrye-common-annotation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.smallrye</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <version>${jandex.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <quiet>true</quiet>
                        <doclint>none</doclint>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-enforcer-rules</artifactId>
                            <version>${project.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>enforce</id>
                            <phase>${maven-enforcer-plugin.phase}</phase>
                            <configuration>
                                <rules>
                                    <dependencyConvergence/>
                                    <externalRules>
                                        <location>classpath:enforcer-rules/quarkus-require-java-version.xml</location>
                                    </externalRules>
                                    <externalRules>
                                        <location>classpath:enforcer-rules/quarkus-require-maven-version.xml</location>
                                    </externalRules>
                                    <externalRules>
                                        <location>classpath:enforcer-rules/quarkus-banned-dependencies.xml</location>
                                    </externalRules>
                                    <bannedDependencies>
                                        <excludes>
                                            <!-- findbugs is not required at runtime -->
                                            <exclude>com.google.code.findbugs:jsr305</exclude>
                                            <!-- com.google.guava:listenablefuture is empty and the ListenableFuture class is available in Guava -->
                                            <exclude>com.google.guava:listenablefuture</exclude>
                                        </excludes>
                                    </bannedDependencies>
                                </rules>
                            </configuration>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.plugin.version}</version>
                    <configuration>
                        <!-- combine.self suppresses warnings about java.io.tmpdir being defined twice -->
                        <systemPropertyVariables combine.self="override"/>
                        <!-- set tmpdir as early as possible because failsafe sets it too late for JDK16 -->
                        <argLine>-Djava.io.tmpdir="${project.build.directory}"</argLine>
                        <excludedEnvironmentVariables>MAVEN_OPTS</excludedEnvironmentVariables>
                        <excludes>
                            <exclude>io.quarkus.test.junit.virtual.internal.ignore.**Test.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>quick-build</id>
            <activation>
                <property>
                    <name>quickly</name>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
                <skipITs>true</skipITs>
                <enforcer.skip>true</enforcer.skip>
            </properties>
            <build>
                <defaultGoal>clean install</defaultGoal>
            </build>
        </profile>
        <profile>
            <id>quick-build-docs</id>
            <activation>
                <property>
                    <name>quicklyDocs</name>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
                <skipITs>true</skipITs>
                <enforcer.skip>true</enforcer.skip>
            </properties>
            <build>
                <defaultGoal>clean install</defaultGoal>
            </build>
        </profile>
        <profile>
            <!-- separate "quickly" profile for CI to keep local "quickly" demands separated from CI demands -->
            <id>quick-build-ci</id>
            <activation>
                <property>
                    <name>quickly-ci</name>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
                <skipITs>true</skipITs>
                <enforcer.skip>true</enforcer.skip>
                <format.skip>true</format.skip>
            </properties>
        </profile>
        <profile>
            <id>format</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>!no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>validate</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>no-format</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <configuration>
                            <removeUnused>true</removeUnused>
                        </configuration>
                        <executions>
                            <execution>
                                <id>check-imports</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
