<?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.Beta6</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

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

    <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.core</groupId>
            <artifactId>wildfly-launcher</artifactId>
        </dependency>
        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-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-jar-maven-plugin</artifactId>   
                <version>${version.org.wildfly.plugins.wildfly-jar-maven-plugin}</version>
                <configuration>
                    <skip>${skipTests}</skip>
                    <feature-pack-location>${galleon.feature.pack.location}</feature-pack-location>
                    <hollowJar>true</hollowJar>
                    <outputFileName>test-wildfly.jar</outputFileName>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>package</goal>
                        </goals>
                        <phase>compile</phase>
                    </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>org.jboss.as.arquillian.container.managed.manual.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>org.jboss.as.arquillian.container.managed.manual.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>
