<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements. See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership. The ASF licenses this file
  ~ to you 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.deltaspike</groupId>
        <artifactId>parent</artifactId>
        <version>2.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>parent-code</artifactId>

    <packaging>pom</packaging>

    <name>Apache DeltaSpike Code Parent</name>
    <description>Apache DeltaSpike Parent for container projects</description>

    <properties>
        <container.unpack.directory>${java.io.tmpdir}/deltaspike-arquillian-containers</container.unpack.directory>
        <wildfly.version>31.0.0.Final</wildfly.version>
        <weld.sfl4j>2.0.11</weld.sfl4j>
        <wildfly.arquillian.version>5.0.1.Final</wildfly.arquillian.version>
        <payara.version>6.2024.2</payara.version>
        <tomee.version>10.0.0-M1-SNAPSHOT</tomee.version>
    </properties>


    <dependencyManagement>
        <dependencies>
            <!-- imports don't get inherited! -->
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${arquillian.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>${jakarta.annotation-api.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>jakarta.inject</groupId>
                <artifactId>jakarta.inject-api</artifactId>
                <version>${jakarta.atinject-api.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>jakarta.enterprise</groupId>
                <artifactId>jakarta.enterprise.cdi-api</artifactId>
                <version>${jakarta.cdi-api.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>jakarta.interceptor</groupId>
                <artifactId>jakarta.interceptor-api</artifactId>
                <version>${jakarta.interceptor-api.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>jakarta.el</groupId>
                <artifactId>jakarta.el-api</artifactId>
                <version>${jakarta.el-api.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>jakarta.transaction</groupId>
                <artifactId>jakarta.transaction-api</artifactId>
                <version>${jakarta.transaction-api.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-servlet-api</artifactId>
                <version>${tomcat.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-jpa_2.2_spec</artifactId>
                <version>1.1</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.openwebbeans</groupId>
                <artifactId>openwebbeans-impl</artifactId>
                <version>${owb.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.openwebbeans</groupId>
                <artifactId>openwebbeans-spi</artifactId>
                <version>${owb.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.openwebbeans.arquillian</groupId>
                <artifactId>owb-arquillian-standalone</artifactId>
                <version>${owb.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.arquillian.testenricher</groupId>
                <artifactId>arquillian-testenricher-cdi-jakarta</artifactId>
                <version>${arquillian.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.deltaspike.test</groupId>
            <artifactId>test-utils</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <systemPropertyVariables>
                            <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                            <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <inherited>true</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>

                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>


    <profiles>

        <profile>
            <id>JBossArchive</id>
            <repositories>
                <repository>
                    <id>JBoss-Archive</id>
                    <name>JBoss Archive</name>
                    <url>https://repository.jboss.org/nexus/content/groups/public</url>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>JBossSnapshots</id>
            <repositories>
                <repository>
                    <id>JBoss-Snapshots</id>
                    <name>JBoss Snapshots</name>
                    <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
                </repository>
            </repositories>
        </profile>


        <profile>
            <!-- use this profile to compile and test DeltaSpike with Apache OpenWebBeans -->
            <id>OWB</id>

            <!-- ensures a correct build at analysis.apache.org -->
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <properties>
                <cdicontainer.version>owb-${owb.version}</cdicontainer.version>

            </properties>

            <repositories>
                <repository>
                    <id>apache-snapshot-repository</id>
                    <url>https://repository.apache.org/snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>

                            <!-- Ignore these groups because they don't work with embedded OWB -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.WebProfileCategory,
                                org.apache.deltaspike.test.category.WebEEProfileCategory,
                                org.apache.deltaspike.test.category.FullProfileCategory,
                                org.apache.deltaspike.test.category.EnterpriseArchiveProfileCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

            <dependencies>
                <dependency>
                    <groupId>jakarta.annotation</groupId>
                    <artifactId>jakarta.annotation-api</artifactId>
                    <version>${jakarta.annotation-api.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>jakarta.inject</groupId>
                    <artifactId>jakarta.inject-api</artifactId>
                    <version>${jakarta.atinject-api.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>jakarta.enterprise</groupId>
                    <artifactId>jakarta.enterprise.cdi-api</artifactId>
                    <version>${jakarta.cdi-api.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>jakarta.interceptor</groupId>
                    <artifactId>jakarta.interceptor-api</artifactId>
                    <version>${jakarta.interceptor-api.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>jakarta.el</groupId>
                    <artifactId>jakarta.el-api</artifactId>
                    <version>${jakarta.el-api.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>jakarta.transaction</groupId>
                    <artifactId>jakarta.transaction-api</artifactId>
                    <version>${jakarta.transaction-api.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-servlet-api</artifactId>
                    <version>${tomcat.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-jpa_2.2_spec</artifactId>
                    <version>1.1</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>org.apache.openwebbeans</groupId>
                    <artifactId>openwebbeans-impl</artifactId>
                    <version>${owb.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.openwebbeans</groupId>
                    <artifactId>openwebbeans-spi</artifactId>
                    <version>${owb.version}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>org.apache.openwebbeans.arquillian</groupId>
                    <artifactId>owb-arquillian-standalone</artifactId>
                    <version>${owb.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.arquillian.testenricher</groupId>
                    <artifactId>arquillian-testenricher-cdi-jakarta</artifactId>
                    <version>${arquillian.version}</version>
                    <scope>test</scope>
                </dependency>

            </dependencies>
        </profile>
        <!-- please note that when changing any of these weld profiles, they are also used in some projects.
        Make sure to update all pom's, if required -->


        <profile>
            <!-- use this profile to compile and test DeltaSpike with JBoss Weld 3.x on an embedded container -->
            <id>Weld</id>

            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            
            <properties>
                <!-- Actual Weld version used with this profile -->
                <weld.version>5.1.2.Final</weld.version>
                <cdicontainer.version>weld-${weld.version}</cdicontainer.version>
            </properties>
            
            <dependencyManagement>
                <dependencies>
                    <!-- Weld Core BOM - used to fetch version of artifacts only -->
                    <dependency>
                        <groupId>org.jboss.weld</groupId>
                        <artifactId>weld-core-bom</artifactId>
                        <version>${weld.version}</version>
                        <type>pom</type>
                        <scope>import</scope>
                    </dependency>
                </dependencies>
            </dependencyManagement>
            
            <dependencies>
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.module</groupId>
                    <artifactId>weld-ejb</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.module</groupId>
                    <artifactId>weld-jsf</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.module</groupId>
                    <artifactId>weld-jta</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.module</groupId>
                    <artifactId>weld-web</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.servlet</groupId>
                    <artifactId>weld-servlet-shaded</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.servlet</groupId>
                    <artifactId>weld-servlet-core</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.se</groupId>
                    <artifactId>weld-se-shaded</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.se</groupId>
                    <artifactId>weld-se-core</artifactId>
                </dependency>         
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-api</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-spi</artifactId>
                </dependency>

                <!--Other than Weld dependencies-->
                <dependency>
                    <groupId>jakarta.el</groupId>
                    <artifactId>jakarta.el-api</artifactId>
                    <version>${jakarta.el-api.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>jakarta.transaction</groupId>
                    <artifactId>jakarta.transaction-api</artifactId>
                    <version>${jakarta.transaction-api.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>jakarta.interceptor</groupId>
                    <artifactId>jakarta.interceptor-api</artifactId>
                    <version>${jakarta.interceptor-api.version}</version>
                </dependency>

                <!-- Test dependencies -->
                <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                    <version>${weld.sfl4j}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-validator</artifactId>
                    <version>8.0.0.Final</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.arquillian.container</groupId>
                    <artifactId>arquillian-weld-embedded</artifactId>
                    <version>${arquillian-weld.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>
                            <!-- Ignore these groups because they don't work with embedded Weld -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.WebProfileCategory,
                                org.apache.deltaspike.test.category.WebEEProfileCategory,
                                org.apache.deltaspike.test.category.FullProfileCategory,
                                org.apache.deltaspike.test.category.EnterpriseArchiveProfileCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!--
             * arquillian-tomee-remote isn't a real remote connector for a running server-instance
             *
             * DEBUGGING:
             * mvn test -Ptomee8-build-managed -Dtest=UnitTestName -Dopenejb.server.debug=true
             * then use remote debuggig at port 5005
             *
            -->
            <id>tomee-build-managed</id>

            <properties>
                <jakartaeeapi.version>10.0-M2</jakartaeeapi.version>
                <owb.version>4.0.2</owb.version>
                <cdicontainer.version>owb-${owb.version}</cdicontainer.version>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.apache.tomee</groupId>
                    <artifactId>jakartaee-api</artifactId>
                    <version>${jakartaeeapi.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomee</groupId>
                    <artifactId>apache-tomee</artifactId>
                    <classifier>webprofile</classifier>
                    <version>${tomee.version}</version>
                    <scope>test</scope>
                    <type>zip</type>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomee</groupId>
                    <artifactId>arquillian-tomee-remote</artifactId>
                    <version>${tomee.version}</version>
                </dependency>

                <!-- needed by arquillian-tomee-remote -->
                <dependency>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                    <version>1.1.1</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration>
                            <systemPropertyVariables>
                                <tomee.version>${tomee.version}</tomee.version>
                                <arquillian.launch>tomee-build-managed</arquillian.launch>
                                <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>

                            <!-- we just use groups to mark that a test should be executed only
                            with specific environments. even though a java-ee6 application server has to be able to run
                            all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
                            there are currently issues with arquillian. if a test isn't restricted to an environment,
                            no category is used for the test-class. -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.WebEEProfileCategory,
                                org.apache.deltaspike.test.category.SeCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!--
             * WildFly has to be locally installed
             *
             * JBOSS_HOME must be set for this to work correctly!
             *
             * Start the build with:
             * $> mvn clean install -Pwildfly-managed -Dweld.version=xxx
             *
             -->
            <id>wildfly-managed</id>
            <properties>
                <!-- Actual default Weld version used with this profile -->
                <weld.version>5.1.2.Final</weld.version>
                <cdicontainer.version>weld-${weld.version}</cdicontainer.version>
            </properties>

            <dependencies>
                <!--This brings in the cdi-api in correct version corresponding to Weld version specified with ${weld.version}-->
                <!--Only for build purposes, for tests, Wildfly provides that-->
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                    <version>${weld.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.wildfly.arquillian</groupId>
                    <artifactId>wildfly-arquillian-container-managed</artifactId>
                    <version>${wildfly.arquillian.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.arquillian.protocol</groupId>
                    <artifactId>arquillian-protocol-servlet-jakarta</artifactId>
                    <version>${arquillian.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration>
                            <systemPropertyVariables>
                                <arquillian.launch>wildfly-managed</arquillian.launch>
                                <arquillian.xml>arquillian-jboss.xml</arquillian.xml>
                                <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                                <jacoco.agent>${jacoco.agent}</jacoco.agent>
                            </systemPropertyVariables>
                            <!-- we just use groups to mark that a test should be executed only
                            with specific environments. even though a java-ee6 application server has to be able to run
                            all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
                            there are currently issues with arquillian. if a test isn't restricted to an environment,
                            no category is used for the test-class. -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.FullProfileCategory,
                                org.apache.deltaspike.test.category.SeCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!--
             * WildFly will be downloaded as maven dependency
             *
             * JBOSS_HOME need not be set for this.
             *
             * Start the build with:
             * $> mvn clean install -Pwildfly-build-managed -Dwildfly.version=10.0.0.Final -Dweld.version=xxx
             *
             -->
            <id>wildfly-build-managed</id>

            <properties>
                <!-- Actual default Weld version used with this profile -->
                <weld.version>5.1.2.Final</weld.version>
                <cdicontainer.version>weld-${weld.version}</cdicontainer.version>
            </properties>

            <dependencies>
                <!--This brings in the cdi-api in correct version corresponding to Weld version specified with ${weld.version}-->
                <!--Only for build purposes, for tests, Wildfly provides that-->
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                    <version>${weld.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.wildfly.arquillian</groupId>
                    <artifactId>wildfly-arquillian-container-managed</artifactId>
                    <version>${wildfly.arquillian.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.arquillian.protocol</groupId>
                    <artifactId>arquillian-protocol-servlet-jakarta</artifactId>
                    <version>${arquillian.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>jakarta.servlet</groupId>
                    <artifactId>jakarta.servlet-api</artifactId>
                    <version>${jakarta.servlet-api.version}</version>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration>
                            <systemPropertyVariables>
                                <arquillian.launch>wildfly-build-managed</arquillian.launch>
                                <arquillian.xml>arquillian-jboss.xml</arquillian.xml>
                                <arquillian.jboss_home>
                                    ${container.unpack.directory}/wildfly-${wildfly.version}
                                </arquillian.jboss_home>
                                <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>
                            <!-- we just use groups to mark that a test should be executed only
                            with specific environments. even though a java-ee6 application server has to be able to run
                            all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
                            there are currently issues with arquillian. if a test isn't restricted to an environment,
                            no category is used for the test-class. -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.EnterpriseArchiveProfileCategory,
                                org.apache.deltaspike.test.category.FullProfileCategory,
                                org.apache.deltaspike.test.category.SeCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-wf</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.wildfly</groupId>
                                            <artifactId>wildfly-dist</artifactId>
                                            <version>${wildfly.version}</version>
                                            <outputDirectory>${container.unpack.directory}</outputDirectory>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>wildfly-remote</id>
            <!-- Wildfly must be started manually for this work correctly - for debug hints see arquillian-jboss.xml -->

            <properties>
                <cdicontainer.version>weld-${weld.version}</cdicontainer.version>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                    <version>${weld.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.wildfly.arquillian</groupId>
                    <artifactId>wildfly-arquillian-container-remote</artifactId>
                    <version>${wildfly.arquillian.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.arquillian.protocol</groupId>
                    <artifactId>arquillian-protocol-servlet-jakarta</artifactId>
                    <version>${arquillian.version}</version>
                    <scope>test</scope>
                </dependency>

            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration>
                            <systemPropertyVariables>
                                <arquillian.launch>wildfly-remote</arquillian.launch>
                                <arquillian.xml>arquillian-jboss.xml</arquillian.xml>
                                <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>
                            <!-- we just use groups to mark that a test should be executed only
                            with specific environments. even though a java-ee6 application server has to be able to run
                            all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
                            there are currently issues with arquillian. if a test isn't restricted to an environment,
                            no category is used for the test-class. -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.FullProfileCategory,
                                org.apache.deltaspike.test.category.SeCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>payara-embedded</id>

            <properties>
                <weld.version>5.0.1.Final</weld.version>
                <cdicontainer.version>weld-${weld.version}</cdicontainer.version>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                    <version>${weld.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>fish.payara.extras</groupId>
                    <artifactId>payara-embedded-all</artifactId>
                    <version>${payara.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>fish.payara.arquillian</groupId>
                    <artifactId>arquillian-payara-server-embedded</artifactId>
                    <version>3.0.alpha8</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <arquillian.launch>payara-build-managed</arquillian.launch>
                                <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>
                            <!-- we just use groups to mark that a test should be executed only
                            with specific environments. even though a java-ee6 application server has to be able to run
                            all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
                            there are currently issues with arquillian. if a test isn't restricted to an environment,
                            no category is used for the test-class. -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.SeCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!--
             * Payara will be downloaded as maven dependency
             *
             * Start the build with:
             * $> mvn clean install -Ppayara-build-managed
             *
             -->
            <id>payara-build-managed</id>

            <properties>
                <weld.version>5.0.1.Final</weld.version>
                <cdicontainer.version>weld-${weld.version}</cdicontainer.version>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                    <version>${weld.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>jakarta.servlet</groupId>
                    <artifactId>jakarta.servlet-api</artifactId>
                    <version>${jakarta.servlet-api.version}</version>
                </dependency>
                <dependency>
                    <groupId>fish.payara.arquillian</groupId>
                    <artifactId>arquillian-payara-server-managed</artifactId>
                    <version>3.0.alpha8</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <arquillian.launch>payara-build-managed</arquillian.launch>
                                <arquillian.payara_home>${container.unpack.directory}/payara6</arquillian.payara_home>
                                <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>
                            <!-- we just use groups to mark that a test should be executed only
                            with specific environments. even though a java-ee6 application server has to be able to run
                            all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
                            there are currently issues with arquillian. if a test isn't restricted to an environment,
                            no category is used for the test-class. -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.SeCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-payara</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>fish.payara.distributions</groupId>
                                            <artifactId>payara</artifactId>
                                            <version>${payara.version}</version>
                                            <outputDirectory>${container.unpack.directory}</outputDirectory>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-payara</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <!-- Change all TCP ports from "xxxx" to "2xxxx" -->
                                        <replaceregexp file="${container.unpack.directory}/payara6/glassfish/domains/domain1/config/domain.xml" match="port=&quot;(\d{4})&quot;" replace="port=&quot;2\1&quot;" flags="g" />
                                        <replace file="${container.unpack.directory}/payara6/glassfish/domains/domain1/config/domain.xml" token="value=&quot;7676&quot;" value="value=&quot;27676&quot;" />

                                        <!-- Replace the default datasource with an in-memory one -->
                                        <replace file="${container.unpack.directory}/payara6/glassfish/domains/domain1/config/domain.xml" token="datasource-classname=&quot;org.apache.derby.jdbc.ClientDataSource&quot;" value="datasource-classname=&quot;org.apache.derby.jdbc.EmbeddedDataSource&quot;" />
                                        <replace file="${container.unpack.directory}/payara6/glassfish/domains/domain1/config/domain.xml" token="value=&quot;sun-appserv-samples&quot;" value="value=&quot;memory:deltaspike&quot;" />
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!--
             * Glassfish will be downloaded as maven dependency
             *
             * Start the build with:
             * $> mvn clean install -Pglassfish-build-managed
             *
             -->
            <id>glassfish-build-managed</id>

            <properties>
                <weld.version>5.1.2.Final</weld.version>
                <cdicontainer.version>weld-${weld.version}</cdicontainer.version>
                <glassfish.version>7.0.13</glassfish.version>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                    <version>${weld.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>jakarta.servlet</groupId>
                    <artifactId>jakarta.servlet-api</artifactId>
                    <version>${jakarta.servlet-api.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.omnifaces.arquillian</groupId>
                    <artifactId>arquillian-glassfish-server-managed</artifactId>
                    <version>1.4</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <arquillian.launch>glassfish-build-managed</arquillian.launch>
                                <arquillian.glassfish_home>${container.unpack.directory}/glassfish7</arquillian.glassfish_home>
                                <org.apache.deltaspike.ProjectStage>UnitTest</org.apache.deltaspike.ProjectStage>
                                <cdicontainer.version>${cdicontainer.version}</cdicontainer.version>
                            </systemPropertyVariables>
                            <!-- we just use groups to mark that a test should be executed only
                            with specific environments. even though a java-ee6 application server has to be able to run
                            all tests in theory, we have to exclude some tests because there are e.g. packaging issues or
                            there are currently issues with arquillian. if a test isn't restricted to an environment,
                            no category is used for the test-class. -->
                            <excludedGroups>
                                org.apache.deltaspike.test.category.SeCategory
                            </excludedGroups>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-glassfish</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.glassfish.main.distributions</groupId>
                                            <artifactId>glassfish</artifactId>
                                            <version>${glassfish.version}</version>
                                            <outputDirectory>${container.unpack.directory}</outputDirectory>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-glassfish</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <!-- Change all TCP ports from "xxxx" to "2xxxx" -->
                                        <replaceregexp file="${container.unpack.directory}/glassfish7/glassfish/domains/domain1/config/domain.xml" match="port=&quot;(\d{4})&quot;" replace="port=&quot;2\1&quot;" flags="g" />
                                        <replace file="${container.unpack.directory}/glassfish7/glassfish/domains/domain1/config/domain.xml" token="value=&quot;7676&quot;" value="value=&quot;27676&quot;" />

                                        <!-- Replace the default datasource with an in-memory one -->
                                        <replace file="${container.unpack.directory}/glassfish7/glassfish/domains/domain1/config/domain.xml" token="datasource-classname=&quot;org.apache.derby.jdbc.ClientDataSource&quot;" value="datasource-classname=&quot;org.apache.derby.jdbc.EmbeddedDataSource&quot;" />
                                        <replace file="${container.unpack.directory}/glassfish7/glassfish/domains/domain1/config/domain.xml" token="value=&quot;sun-appserv-samples&quot;" value="value=&quot;memory:deltaspike&quot;" />
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
