<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2020 the original author or authors.

  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.amqphub.quarkus</groupId>
        <artifactId>quarkus-qpid-jms-parent</artifactId>
        <version>0.11.2</version>
    </parent>

    <artifactId>quarkus-qpid-jms-integration-tests</artifactId>
    <name>Quarkus Qpid JMS - Integration Tests</name>
    <description>Quarkus Qpid JMS integration tests module</description>

    <properties>
        <artemis.version>2.11.0</artemis.version>
        <surefire.plugin.version>2.22.1</surefire.plugin.version>
        <failsafe.plugin.version>2.22.1</failsafe.plugin.version>
        <jar.plugin.version>3.1.0</jar.plugin.version>
    </properties>

    <dependencies>
        <!-- Quarkus Qpid JMS -->
        <dependency>
            <groupId>org.amqphub.quarkus</groupId>
            <artifactId>quarkus-qpid-jms</artifactId>
        </dependency>

        <!-- JAX-RS -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy</artifactId>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-test-artemis</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jackson</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- TODO: remove this once quarkus-test-artemis 1.3.0 includes it -->
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-amqp-protocol</artifactId>
            <version>${artemis.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.activemq</groupId>
                    <artifactId>artemis-server</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-json_1.0_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.johnzon</groupId>
                    <artifactId>johnzon-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>commons-logging-jboss-logging</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                    <configuration>
                        <noDeps>true</noDeps>
                        <skip>${quarkus.build.skip}</skip>
                    </configuration>
                </plugin>
                <plugin>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <version>${surefire.plugin.version}</version>
                  <configuration>
                    <systemProperties>
                      <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                    </systemProperties>
                  </configuration>
                </plugin>
                <plugin>
                  <artifactId>maven-failsafe-plugin</artifactId>
                  <version>${failsafe.plugin.version}</version>
                </plugin>
                <plugin>
                  <artifactId>maven-jar-plugin</artifactId>
                  <version>${jar.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <properties>
                <quarkus.package.type>native</quarkus.package.type>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <systemProperties>
                                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                                    </systemProperties>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
