<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Red Hat, Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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.0.1.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>wildfly-arquillian-container-managed</artifactId>
    <name>WildFly: Arquillian Managed Container</name>
    <packaging>jar</packaging>
    
    <dependencies>
        <dependency>
            <groupId>org.wildfly.arquillian</groupId>
            <artifactId>wildfly-arquillian-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-nio</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.marshalling</groupId>
            <artifactId>jboss-marshalling</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.marshalling</groupId>
            <artifactId>jboss-marshalling-river</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.remoting</groupId>
            <artifactId>jboss-remoting</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.remotingjmx</groupId>
            <artifactId>remoting-jmx</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.jboss.galleon</groupId>
                <artifactId>galleon-maven-plugin</artifactId>
            </plugin>
            <!-- Create a test agent for the BootWithAgentTestCase -->
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>package-agent</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <phase>process-test-classes</phase>
                        <configuration>
                            <skip>${skipTests}</skip>
                            <finalName>logging-agent</finalName>
                            <includes>
                                <include>**/LoggingAgent.class</include>
                            </includes>
                            <archive>
                                <manifestEntries>
                                    <Premain-Class>org.jboss.as.arquillian.container.managed.agent.LoggingAgent</Premain-Class>
                                </manifestEntries>
                            </archive>
                            <outputDirectory>${jboss.home}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enable-yaml-configuration</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <mkdir dir="${jboss.home}/modules/system/layers/base/org/jboss/as/controller/main/dir/META-INF/services/"/>
                                <echo file="${jboss.home}/modules/system/layers/base/org/jboss/as/controller/main/dir/META-INF/services/org.jboss.as.controller.persistence.ConfigurationExtension"
                                      append="false" message="org.jboss.as.controller.persistence.yaml.YamlConfigurationExtension"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>default</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <excludedGroups>org.jboss.as.arquillian.container.managed.manual.ManualMode</excludedGroups>
                            <excludes>
                                <exclude>**/AddAgentTestCase.java</exclude>
                                <exclude>**/ThreadContextClassloaderTest.java</exclude>
                                <exclude>**/ManagedInContainerTestCase.java</exclude>
                            </excludes>
                            <systemPropertyVariables>
                                <jboss.home>${jboss.home}</jboss.home>
                            </systemPropertyVariables>
                            <environmentVariables>
                                <JBOSS_HOME>${jboss.home}</JBOSS_HOME>
                            </environmentVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>agent-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <includes>
                                <include>**/AddAgentTestCase.java</include>
                            </includes>
                            <systemPropertyVariables>
                                <arquillian.xml>agent-arquillian.xml</arquillian.xml>
                                <agent.path>${jboss.home}${file.separator}logging-agent-tests.jar</agent.path>
                                <jboss.log.dir>${jboss.home}/standalone/log</jboss.log.dir>
                            </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>
                                <include>**/ManagedInContainerTestCase.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>
                                <jboss.home>${jboss.home}</jboss.home>
                            </systemPropertyVariables>
                            <environmentVariables>
                                <JBOSS_HOME>${jboss.home}</JBOSS_HOME>
                            </environmentVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
