<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~
  ~ Copyright 2021 Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags.
  ~
  ~ 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">
    <parent>
        <artifactId>testsuite</artifactId>
        <groupId>org.jboss.resteasy.microprofile</groupId>
        <version>3.0.0.Alpha1</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>integration-tests</artifactId>
    <name>RESTEasy MicroProfile: Integration Tests</name>

    <properties>
        <!-- Galleon -->
        <jboss.home>${project.build.directory}${file.separator}wildfly</jboss.home>

        <!-- Feature Packs -->
        <wildfly.feature.pack.groupId>org.wildfly</wildfly.feature.pack.groupId>
        <wildfly.feature.pack.artifactId>wildfly-galleon-pack</wildfly.feature.pack.artifactId>
        <wildfly.feature.pack.version>${version.org.wildfly}</wildfly.feature.pack.version>

        <resteasy.feature.pack.groupId>org.jboss.resteasy</resteasy.feature.pack.groupId>
        <resteasy.feature.pack.artifactId>galleon-feature-pack</resteasy.feature.pack.artifactId>
        <resteasy.feature.pack.version>${version.org.jboss.resteasy}</resteasy.feature.pack.version>

        <feature.pack.groupId>org.jboss.resteasy.microprofile</feature.pack.groupId>
        <feature.pack.artifactId>galleon-feature-pack</feature.pack.artifactId>
        <feature.pack.version>${project.version}</feature.pack.version>


        <jboss.arguments/>
    </properties>

    <dependencies>
        <dependency>
            <groupId>jakarta.enterprise</groupId>
            <artifactId>jakarta.enterprise.cdi-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.enterprise.concurrent</groupId>
            <artifactId>jakarta.enterprise.concurrent-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.json.bind</groupId>
            <artifactId>jakarta.json.bind-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.smallrye.config</groupId>
            <artifactId>smallrye-config</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client-vertx</artifactId>
            <version>${version.org.jboss.resteasy}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <version>${version.resteasy.testsuite}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client-api</artifactId>
            <version>${version.resteasy.testsuite}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-core-spi</artifactId>
            <version>${version.resteasy.testsuite}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-core</artifactId>
            <version>${version.resteasy.testsuite}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-multipart-provider</artifactId>
            <version>${version.resteasy.testsuite}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${version.org.junit}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.junit5</groupId>
            <artifactId>arquillian-junit5-container</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>yasson</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.parsson</groupId>
            <artifactId>parsson</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-dmr</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-json-binding-provider</artifactId>
            <scope>test</scope>
            <version>${version.resteasy.testsuite}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-json-p-provider</artifactId>
            <scope>test</scope>
            <version>${version.resteasy.testsuite}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>arquillian-utils</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-rest-client</artifactId>
            <scope>test</scope>
            <version>${version.resteasy.microprofile.testsuite}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-rest-client-base</artifactId>
            <scope>test</scope>
            <version>${version.resteasy.microprofile.testsuite}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.rest.client</groupId>
            <artifactId>microprofile-rest-client-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-config</artifactId>
            <scope>test</scope>
            <version>${version.resteasy.microprofile.testsuite}</version>
        </dependency>

        <dependency>
            <groupId>org.wildfly.arquillian</groupId>
            <artifactId>wildfly-arquillian-container-managed</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wildfly.arquillian</groupId>
            <artifactId>wildfly-testing-tools</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
            <testResource>
                <directory>src/test/resources/filtered</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <jboss.home>${jboss.home}</jboss.home>
                        <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <configuration>
                    <provisioning-dir>${jboss.home}</provisioning-dir>
                    <offline>${galleon.offline}</offline>
                    <feature-packs>
                        <feature-pack>
                            <groupId>${wildfly.feature.pack.groupId}</groupId>
                            <artifactId>${wildfly.feature.pack.artifactId}</artifactId>
                            <version>${wildfly.feature.pack.version}</version>
                            <inherit-configs>false</inherit-configs>
                            <included-configs>
                                <config>
                                    <model>standalone</model>
                                    <name>standalone.xml</name>
                                </config>
                            </included-configs>
                            <excluded-packages>
                                <name>docs.schema</name>
                                <name>appclient</name>
                                <name>domain</name>
                            </excluded-packages>
                        </feature-pack>
                        <feature-pack>
                            <groupId>${resteasy.feature.pack.groupId}</groupId>
                            <artifactId>${resteasy.feature.pack.artifactId}</artifactId>
                            <version>${resteasy.feature.pack.version}</version>
                        </feature-pack>
                        <feature-pack>
                            <groupId>${feature.pack.groupId}</groupId>
                            <artifactId>${feature.pack.artifactId}</artifactId>
                            <version>${feature.pack.version}</version>
                        </feature-pack>
                    </feature-packs>
                    <galleon-options>
                        <jboss-fork-embedded>${galleon.fork.embedded}</jboss-fork-embedded>
                        <jboss-maven-dist/>
                    </galleon-options>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>provided.server</id>
            <activation>
                <property>
                    <name>server.home</name>
                </property>
            </activation>
            <properties>
                <jboss.home>${server.home}</jboss.home>
            </properties>
        </profile>
        <profile>
            <id>provision.server</id>
            <activation>
                <property>
                    <name>!server.home</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.wildfly.plugins</groupId>
                        <artifactId>wildfly-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>server-provisioning</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>provision</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>security.manager</id>
            <activation>
                <property>
                    <name>security.manager</name>
                </property>
            </activation>
            <properties>
                <jboss.arguments>-secmgr</jboss.arguments>
            </properties>
        </profile>
        <profile>
            <id>provision.preview.server</id>
            <activation>
                <property>
                    <name>provision.preview</name>
                </property>
            </activation>

            <properties>
                <!-- Galleon -->
                <wildfly.feature.pack.artifactId>wildfly-preview-feature-pack</wildfly.feature.pack.artifactId>
                <resteasy.feature.pack.artifactId>galleon-preview-feature-pack</resteasy.feature.pack.artifactId>
                <feature.pack.artifactId>galleon-preview-feature-pack</feature.pack.artifactId>
            </properties>
        </profile>
    </profiles>

</project>