<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-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.wildfly.arquillian</groupId>
        <artifactId>wildfly-arquillian-parent</artifactId>
        <version>5.1.0.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>wildfly-arquillian-container-bootable</artifactId>
    <name>WildFly Arquillian: Bootable jar Container</name>
    <packaging>jar</packaging>

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

    <dependencies>
        <dependency>
            <groupId>org.wildfly.arquillian</groupId>
            <artifactId>wildfly-arquillian-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.launcher</groupId>
            <artifactId>wildfly-launcher</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-suite</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.junit5</groupId>
            <artifactId>arquillian-junit5-container</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.protocol</groupId>
            <artifactId>arquillian-protocol-servlet-jakarta</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wildfly.arquillian</groupId>
            <artifactId>wildfly-arquillian-protocol-jmx</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- needed only for InjectJndiContextTestCase#shouldInjectJndiContext-->
        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-ejb-client</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.enterprise</groupId>
            <artifactId>jakarta.enterprise.cdi-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.ejb</groupId>
            <artifactId>jakarta.ejb-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>package</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <bootable-jar>true</bootable-jar>
                            <skipDeployment>true</skipDeployment>
                            <bootable-jar-name>test-wildfly.jar</bootable-jar-name>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <systemProperties>
                        <!-- This is not used by the bootable container. This is only set for testing we fixed
                             WFARQ-74. -->
                        <jboss.home>${jboss.home}</jboss.home>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <id>default</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <!-- We want to run the not-enabled-by-default *TestSuite.java files,
                                 so enumerate the expected test class patterns. -->
                            <includes>
                                <include>**/*Test.java</include>
                                <include>**/*TestCase.java</include>
                                <include>**/*TestSuite.java</include>
                            </includes>
                            <excludedGroups>ManualMode</excludedGroups>
                            <excludes>
                                <exclude>**/ThreadContextClassloaderTest.java</exclude>
                                <!-- These run as part of test suites -->
                                <exclude>**/ServerSetup*TestCase.java</exclude>
                            </excludes>
                            <systemPropertyVariables>
                                <install.dir>${jboss.home}</install.dir>
                                <bootable.jar>target/test-wildfly.jar</bootable.jar>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jmx-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <includes>
                                <include>**/ThreadContextClassloaderTest.java</include>
                            </includes>
                            <systemPropertyVariables>
                                <arquillian.xml>jmx-arquillian.xml</arquillian.xml>
                                <install.dir>${jboss.home}</install.dir>
                                <bootable.jar>target/test-wildfly.jar</bootable.jar>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>manual</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <groups>ManualMode</groups>
                            <systemPropertyVariables>
                                <arquillian.xml>manual-arquillian.xml</arquillian.xml>
                                <install.dir>${jboss.home}</install.dir>
                                <bootable.jar>target/test-wildfly.jar</bootable.jar>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
