<?xml version="1.0"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>io.quarkiverse.googlecloudservices</groupId>
    <artifactId>quarkus-google-cloud-services-integration-tests-parent</artifactId>
    <version>2.2.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>quarkus-google-cloud-services-main-it</artifactId>
  <name>Quarkus - Google Cloud Services - Integration Tests - Main</name>

  <properties>
    <native.surefire.skip>${skipTests}</native.surefire.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-reactive-jackson</artifactId>
    </dependency>

    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-storage</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-pubsub</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-bigquery</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-bigtable</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-firestore</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-spanner</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-secret-manager</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.googlecloudservices</groupId>
      <artifactId>quarkus-google-cloud-logging</artifactId>
    </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>
    <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>gcloud</artifactId>
      <version>1.18.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit-pioneer</groupId>
      <artifactId>junit-pioneer</artifactId>
      <version>2.0.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>${quarkus.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <graalvmHome>${graalvmHome}</graalvmHome>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemProperties>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
          </systemProperties>
        </configuration>
      </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>
      <build>
        <plugins>
          <plugin>
            <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>
      <properties>
        <quarkus.package.type>native</quarkus.package.type>
      </properties>
    </profile>
    <profile>
      <id>gcloud</id>
      <activation>
          <property>
            <name>gcloud</name>
          </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemProperties>
                <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                <gcloud.test>true</gcloud.test>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
