<?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">
  <parent>
    <artifactId>hadoop-project</artifactId>
    <groupId>org.apache.hadoop</groupId>
    <version>3.5.0</version>
    <relativePath>../../hadoop-project/pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>hadoop-gcp</artifactId>
  <name>Apache Hadoop Google Cloud Platform support</name>
  <version>3.5.0</version>
  <description>This module contains code to support integration with Google Cloud Platform.
    It also declares the dependencies needed to work with Google Cloud Storage.</description>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <excludeFilterFiles>
            <excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
            <excludeFilterFile>${repo.root}/dev-support/findbugs-exclude-global.xml</excludeFilterFile>
          </excludeFilterFiles>
          <effort>Max</effort>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <suppressionsLocation>src/config/checkstyle-suppressions.xml</suppressionsLocation>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkedProcessTimeoutInSeconds>3600</forkedProcessTimeoutInSeconds>
          <systemPropertyVariables>
            <test.default.timeout>${test.integration.timeout}</test.default.timeout>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>banned-illegal-imports</id>
            <phase>process-sources</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <restrictImports>
                  <includeTestCode>false</includeTestCode>
                  <reason>Restrict mapreduce imports to committer code</reason>
                  <exclusions />
                  <bannedImports>
                    <bannedImport>org.apache.hadoop.mapreduce.**</bannedImport>
                    <bannedImport>org.apache.hadoop.mapred.**</bannedImport>
                  </bannedImports>
                </restrictImports>
                <restrictImports>
                  <includeTestCode>false</includeTestCode>
                  <reason>Restrict encryption client imports to encryption client factory</reason>
                  <exclusions />
                  <bannedImports />
                </restrictImports>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>deplist</id>
            <phase>compile</phase>
            <goals>
              <goal>list</goal>
            </goals>
            <configuration>
              <outputFile>${project.basedir}/target/hadoop-cloud-storage-deps/${project.artifactId}.cloud-storage-optional.txt</outputFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>tests-off</id>
      <properties>
        <os.detected.arch>x86_64</os.detected.arch>
        <os.detected.release.like.debian>true</os.detected.release.like.debian>
        <os.detected.classifier>linux-x86_64</os.detected.classifier>
        <os.detected.release>ubuntu</os.detected.release>
        <os.detected.release.version>24.04</os.detected.release.version>
        <os.detected.bitness>64</os.detected.bitness>
        <os.detected.name>linux</os.detected.name>
        <os.detected.release.like.ubuntu>true</os.detected.release.like.ubuntu>
        <skipITs>true</skipITs>
      </properties>
    </profile>
    <profile>
      <id>tests-on</id>
      <properties>
        <skipITs>false</skipITs>
      </properties>
    </profile>
    <profile>
      <id>parallel-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-maven-plugins</artifactId>
            <executions>
              <execution>
                <id>parallel-tests-createdir</id>
                <goals>
                  <goal>parallel-tests-createdir</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <forkCount>${testsThreadCount}</forkCount>
              <reuseForks>false</reuseForks>
              <trimStackTrace>false</trimStackTrace>
              <argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
              <systemPropertyVariables>
                <testsThreadCount>${testsThreadCount}</testsThreadCount>
                <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
                <test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
                <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
                <test.unique.fork.id>job-${job.id}-fork-000${surefire.forkNumber}</test.unique.fork.id>
              </systemPropertyVariables>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <id>default-integration-test</id>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <configuration>
                  <forkCount>${testsThreadCount}</forkCount>
                  <reuseForks>false</reuseForks>
                  <argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
                  <forkedProcessTimeoutInSeconds>${fs.gs.scale.test.timeout}</forkedProcessTimeoutInSeconds>
                  <trimStackTrace>false</trimStackTrace>
                  <systemPropertyVariables>
                    <test.parallel.execution>true</test.parallel.execution>
                    <test.build.data>${test.build.data}/${surefire.forkNumber}</test.build.data>
                    <test.build.dir>${test.build.dir}/${surefire.forkNumber}</test.build.dir>
                    <hadoop.tmp.dir>${hadoop.tmp.dir}/${surefire.forkNumber}</hadoop.tmp.dir>
                    <test.unique.fork.id>job-${job.id}-fork-000${surefire.forkNumber}</test.unique.fork.id>
                    <test.default.timeout>${test.integration.timeout}</test.default.timeout>
                  </systemPropertyVariables>
                  <includes>
                    <include>**/ITest*.java</include>
                  </includes>
                </configuration>
              </execution>
              <execution>
                <id>sequential-integration-tests</id>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <configuration>
                  <forkedProcessTimeoutInSeconds>${fs.gs.scale.test.timeout}</forkedProcessTimeoutInSeconds>
                  <trimStackTrace>false</trimStackTrace>
                  <systemPropertyVariables>
                    <test.parallel.execution>false</test.parallel.execution>
                    <test.unique.fork.id>job-${job.id}</test.unique.fork.id>
                  </systemPropertyVariables>
                  <includes>
                    <include>**/ITest*.java</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sequential-tests</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
                <configuration>
                  <trimStackTrace>false</trimStackTrace>
                  <systemPropertyVariables>
                    <test.unique.fork.id>job-${job.id}</test.unique.fork.id>
                  </systemPropertyVariables>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <os.detected.arch>x86_64</os.detected.arch>
        <os.detected.release.like.debian>true</os.detected.release.like.debian>
        <os.detected.classifier>linux-x86_64</os.detected.classifier>
        <os.detected.release>ubuntu</os.detected.release>
        <os.detected.release.version>24.04</os.detected.release.version>
        <os.detected.bitness>64</os.detected.bitness>
        <os.detected.name>linux</os.detected.name>
        <os.detected.release.like.ubuntu>true</os.detected.release.like.ubuntu>
      </properties>
    </profile>
    <profile>
      <id>shade</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <transformers>
                    <transformer />
                    <transformer />
                    <transformer />
                  </transformers>
                  <filters>
                    <filter>
                      <artifact>com.google.auth:*</artifact>
                      <includes>
                        <include>**</include>
                      </includes>
                    </filter>
                    <filter>
                      <artifact>io.grpc:*</artifact>
                      <includes>
                        <include>**</include>
                      </includes>
                    </filter>
                    <filter>
                      <artifact>io.opencensus:*</artifact>
                      <includes>
                        <include>**</include>
                      </includes>
                    </filter>
                    <filter>
                      <artifact>*:*</artifact>
                      <excludes>
                        <exclude>*.json</exclude>
                        <exclude>google/**</exclude>
                        <exclude>grpc/**</exclude>
                      </excludes>
                    </filter>
                  </filters>
                  <artifactSet>
                    <includes>
                      <include>com.google.api</include>
                      <include>com.google.api-client</include>
                      <include>com.google.api.grpc</include>
                      <include>com.google.apis</include>
                      <include>com.google.auth</include>
                      <include>com.google.cloud</include>
                      <include>com.google.cloud.bigdataoss</include>
                      <include>com.google.cloud.grpc</include>
                      <include>com.google.cloud.http</include>
                      <include>com.google.flogger</include>
                      <include>com.google.code.gson</include>
                      <include>com.google.guava</include>
                      <include>com.google.http-client</include>
                      <include>com.google.oauth-client</include>
                      <include>com.google.protobuf</include>
                      <include>com.google.re2j</include>
                      <include>com.google.storage.v2</include>
                      <include>com.lmax</include>
                      <include>io.grpc</include>
                      <include>io.opencensus</include>
                      <include>io.opentelemetry</include>
                      <include>io.opentelemetry.api</include>
                      <include>io.opentelemetry.contrib</include>
                      <include>io.opentelemetry.semconv</include>
                      <include>io.perfmark</include>
                      <include>org.apache.httpcomponents</include>
                      <include>org.threeten:threetenbp</include>
                    </includes>
                  </artifactSet>
                  <minimizeJar>true</minimizeJar>
                  <relocations>
                    <relocation>
                      <pattern>com</pattern>
                      <shadedPattern>com.google.cloud.hadoop.repackaged.ossgcs.com</shadedPattern>
                      <includes>
                        <include>com.google.api.**</include>
                        <include>com.google.api.gax.**</include>
                        <include>com.google.auth.**</include>
                        <include>com.google.cloud.*</include>
                        <include>com.google.cloud.audit.**</include>
                        <include>com.google.cloud.grpc.**</include>
                        <include>com.google.cloud.hadoop.gcsio.**</include>
                        <include>com.google.cloud.hadoop.util.**</include>
                        <include>com.google.cloud.http.**</include>
                        <include>com.google.cloud.monitoring.**</include>
                        <include>com.google.cloud.opentelemetry.**</include>
                        <include>com.google.cloud.spi.**</include>
                        <include>com.google.cloud.storage.**</include>
                        <include>com.google.common.**</include>
                        <include>com.google.geo.**</include>
                        <include>com.google.gson.**</include>
                        <include>com.google.google.storage.**</include>
                        <include>com.google.iam.**</include>
                        <include>com.google.logging.**</include>
                        <include>com.google.longrunning.**</include>
                        <include>com.google.monitoring.**</include>
                        <include>com.google.protobuf.**</include>
                        <include>com.google.re2j.**</include>
                        <include>com.google.rpc.**</include>
                        <include>com.google.storage.**</include>
                        <include>com.google.thirdparty.**</include>
                        <include>com.google.type.**</include>
                        <include>com.lmax.disruptor.**</include>
                      </includes>
                      <excludes>
                        <exclude>com.google.cloud.hadoop.util.AccessTokenProvider</exclude>
                        <exclude>com.google.cloud.hadoop.util.AccessTokenProvider$AccessToken</exclude>
                        <exclude>com.google.cloud.hadoop.util.AccessTokenProvider$AccessTokenType</exclude>
                        <exclude>com.google.cloud.hadoop.util.AccessBoundary</exclude>
                        <exclude>com.google.cloud.hadoop.util.AccessBoundary$Action</exclude>
                        <exclude>com.google.cloud.hadoop.util.AutoValue_AccessBoundary</exclude>
                      </excludes>
                    </relocation>
                    <relocation>
                      <pattern>org</pattern>
                      <shadedPattern>com.google.cloud.hadoop.repackaged.ossgcs.org</shadedPattern>
                      <includes>
                        <include>org.apache.http.**</include>
                        <include>org.threeten.**</include>
                      </includes>
                    </relocation>
                    <relocation>
                      <pattern>io.grpc.netty.shaded</pattern>
                      <shadedPattern>com.google.cloud.hadoop.repackaged.ossgcs.io.grpc.netty.shaded</shadedPattern>
                    </relocation>
                    <relocation>
                      <pattern>io</pattern>
                      <shadedPattern>com.google.cloud.hadoop.repackaged.ossgcs.io</shadedPattern>
                      <includes>
                        <include>io.grpc.**</include>
                        <include>io.opencensus.**</include>
                        <include>io.opentelemetry.**</include>
                        <include>io.perfmark.**</include>
                      </includes>
                    </relocation>
                    <relocation>
                      <pattern>META-INF/native/io_grpc_netty_shaded_</pattern>
                      <shadedPattern>META-INF/native/com_google_cloud_hadoop_repackaged_gcs_io_grpc_netty_shaded_</shadedPattern>
                    </relocation>
                    <relocation>
                      <pattern>META-INF/native/libio_grpc_netty_shaded_</pattern>
                      <shadedPattern>META-INF/native/libcom_google_cloud_hadoop_repackaged_gcs_io_grpc_netty_shaded_</shadedPattern>
                    </relocation>
                  </relocations>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <os.detected.arch>x86_64</os.detected.arch>
        <os.detected.release.like.debian>true</os.detected.release.like.debian>
        <os.detected.classifier>linux-x86_64</os.detected.classifier>
        <os.detected.release>ubuntu</os.detected.release>
        <os.detected.release.version>24.04</os.detected.release.version>
        <os.detected.bitness>64</os.detected.bitness>
        <os.detected.name>linux</os.detected.name>
        <os.detected.release.like.ubuntu>true</os.detected.release.like.ubuntu>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <version>3.5.0</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>servlet-api</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>cdi-api</artifactId>
          <groupId>javax.enterprise</groupId>
        </exclusion>
        <exclusion>
          <artifactId>guava</artifactId>
          <groupId>com.google.guava</groupId>
        </exclusion>
        <exclusion>
          <artifactId>protobuf-java</artifactId>
          <groupId>com.google.protobuf</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <version>3.5.0</version>
      <type>test-jar</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>guava</artifactId>
          <groupId>com.google.guava</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.12.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <version>1.13.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.13.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>opentest4j</artifactId>
          <groupId>org.opentest4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-platform-commons</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.13.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.13.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>33.4.0-jre</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>3.25.5</version>
      </dependency>
      <dependency>
        <groupId>io.opentelemetry</groupId>
        <artifactId>opentelemetry-bom</artifactId>
        <version>1.59.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <properties>
    <hadoop.tmp.dir>${project.build.directory}/test</hadoop.tmp.dir>
    <file.encoding>UTF-8</file.encoding>
    <downloadSources>true</downloadSources>
  </properties>
</project>
