<?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>2.1.3.Final</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>com.io7m.xom</groupId>
            <artifactId>xom</artifactId>
        </dependency>

        <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>junit</groupId>
            <artifactId>junit</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.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-json-binding-provider</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-json-p-provider</artifactId>
            <scope>test</scope>
        </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>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy.microprofile</groupId>
            <artifactId>microprofile-config</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.wildfly.arquillian</groupId>
            <artifactId>wildfly-arquillian-container-managed</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>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jboss.galleon</groupId>
                <artifactId>galleon-maven-plugin</artifactId>
                <configuration>
                    <install-dir>${jboss.home}</install-dir>
                    <record-state>false</record-state>
                    <log-time>${galleon.log.time}</log-time>
                    <offline>${galleon.offline}</offline>
                    <plugin-options>
                        <!-- <jboss-maven-dist/> -->
                        <jboss-fork-embedded>${galleon.fork.embedded}</jboss-fork-embedded>
                        <optional-packages>passive+</optional-packages>
                    </plugin-options>
                    <feature-packs>
                        <feature-pack>
                            <groupId>${wildfly.feature.pack.groupId}</groupId>
                            <artifactId>${wildfly.feature.pack.artifactId}</artifactId>
                            <version>${wildfly.feature.pack.version}</version>
                        </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>
                            <excluded-packages>
                                <name>product.conf</name>
                                <name>docs.schema</name>
                            </excluded-packages>
                        </feature-pack>
                    </feature-packs>
                    <configurations>
                        <config>
                            <model>standalone</model>
                            <name>standalone.xml</name>
                            <layers>
                                <layer>cdi</layer>
                                <layer>jaxrs-server</layer>
                                <layer>microprofile-config</layer>
                            </layers>
                        </config>
                    </configurations>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>ci</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>org.jboss.resteasy.microprofile.test.util.IgnoreOnCi</excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <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.jboss.galleon</groupId>
                        <artifactId>galleon-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>server-provisioning</id>
                                <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>