<?xml version="1.0" encoding="UTF-8"?>
<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>it.geosolutions.imageio-ext</groupId>
    <artifactId>imageio-ext-cog</artifactId>
    <version>2.1-SNAPSHOT</version>
  </parent>
  <artifactId>imageio-ext-cog-reader</artifactId>

  <name>Cloud Optimized GeoTIFF Reader</name>
  <properties>
    <skipITs>true</skipITs>
  </properties>
  <dependencies>
    <dependency>
      <groupId>it.geosolutions.imageio-ext</groupId>
      <artifactId>imageio-ext-tiff</artifactId>
    </dependency>
    <dependency>
      <groupId>it.geosolutions.imageio-ext</groupId>
      <artifactId>imageio-ext-cog-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>it.geosolutions.imageio-ext</groupId>
      <artifactId>imageio-ext-cog-streams</artifactId>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers-nginx</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers-azure</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.azure</groupId>
      <artifactId>azure-storage-blob</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers-localstack</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers-minio</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.aiven</groupId>
      <artifactId>testcontainers-fake-gcs-server</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.5.6</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <skipITs>${skipITs}</skipITs>
            <skipTests>false</skipTests>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <runOrder>alphabetical</runOrder>
          <includes>
            <include>**/*Test.java</include>
          </includes>
          <excludes>
            <exclude>${online.skip.pattern}</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <profile>
      <id>online</id>
      <properties>
        <online.skip.pattern>disabled</online.skip.pattern>
      </properties>
      <dependencies>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-http</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-s3</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-gs</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-azure</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>cog-http</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/http/**/*IT.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <jar.finalName>${project.artifactId}-http-${project.version}</jar.finalName>
      </properties>
      <dependencies>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-http</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>cog-s3</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/s3/**/*IT.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <jar.finalName>${project.artifactId}-s3-${project.version}</jar.finalName>
      </properties>
      <dependencies>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-s3</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>cog-azure</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/azure/**/*IT.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <jar.finalName>${project.artifactId}-azure-${project.version}</jar.finalName>
      </properties>
      <dependencies>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-azure</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>cog-gs</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/gs/**/*IT.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <jar.finalName>${project.artifactId}-gs-${project.version}</jar.finalName>
      </properties>
      <dependencies>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-gs</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>cog-all</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <!-- Run all integration tests (*IT.java) -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
      <properties>
        <jar.finalName>${project.artifactId}-all-${project.version}</jar.finalName>
      </properties>
      <dependencies>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-http</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-s3</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-gs</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>it.geosolutions.imageio-ext</groupId>
          <artifactId>imageio-ext-cog-rangereader-azure</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

  </profiles>

</project>
