<project 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>

  <!--Arifact name and version information-->
  <groupId>net.snowflake</groupId>
  <artifactId>snowflake-ingest-sdk</artifactId>
  <version>2.0.4-unshaded</version>
  <packaging>jar</packaging>
  <name>Snowflake Ingest SDK</name>
  <description>Snowflake Ingest SDK</description>
  <url>https://www.snowflake.net/</url>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Snowflake Support Team</name>
      <email>snowflake-java@snowflake.net</email>
      <organization>Snowflake Computing</organization>
      <organizationUrl>https://www.snowflake.net</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/snowflakedb/snowflake-ingest-java</connection>
    <url>https://github.com/snowflakedb/snowflake-ingest-java/tree/master</url>
  </scm>

  <!--Set our Language Level to Java 8-->
  <properties>
    <bouncycastle.version>1.74</bouncycastle.version>
    <codehaus.version>1.9.13</codehaus.version>
    <commonscodec.version>1.15</commonscodec.version>
    <commonscollections.version>3.2.2</commonscollections.version>
    <commonscompress.version>1.21</commonscompress.version>
    <commonsio.version>2.8.0</commonsio.version>
    <commonslang3.version>3.12.0</commonslang3.version>
    <commonslogging.version>1.2</commonslogging.version>
    <commonstext.version>1.10.0</commonstext.version>
    <fasterxml.version>2.14.0</fasterxml.version>
    <guava.version>32.0.1-jre</guava.version>
    <hadoop.version>3.3.6</hadoop.version>
    <jacoco.skip.instrument>true</jacoco.skip.instrument>
    <jacoco.version>0.8.5</jacoco.version>
    <license.processing.dependencyJarsDir>${project.build.directory}/dependency-jars</license.processing.dependencyJarsDir>
    <license.processing.dependencyListFile>${project.build.directory}/dependency-list.txt</license.processing.dependencyListFile>
    <license.processing.resourcesRoot>${project.build.directory}/generated-licenses-info</license.processing.resourcesRoot>
    <license.processing.targetDir>${license.processing.resourcesRoot}/META-INF/third-party-licenses</license.processing.targetDir>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <net.minidev.version>2.4.9</net.minidev.version>
    <netty.version>4.1.94.Final</netty.version>
    <nimbusds.version>9.31</nimbusds.version>
    <objenesis.version>3.1</objenesis.version>
    <parquet.version>1.13.1</parquet.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <protobuf.version>3.19.6</protobuf.version>
    <shadeBase>net.snowflake.ingest.internal</shadeBase>
    <slf4j.version>1.7.36</slf4j.version>
    <snappy.version>1.1.10.4</snappy.version>
    <snowjdbc.version>3.13.30</snowjdbc.version>
    <yetus.version>0.13.0</yetus.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${fasterxml.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>com.nimbusds</groupId>
        <artifactId>nimbus-jose-jwt</artifactId>
        <version>${nimbusds.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>${commonscodec.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>${commonscollections.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commonsio.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>${commonslogging.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-buffer</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-common</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>net.minidev</groupId>
        <artifactId>json-smart</artifactId>
        <version>${net.minidev.version}</version>
      </dependency>
      <dependency>
        <groupId>net.snowflake</groupId>
        <artifactId>snowflake-jdbc</artifactId>
        <version>${snowjdbc.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${commonscompress.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commonslang3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-text</artifactId>
        <version>${commonstext.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-common</artifactId>
        <version>${hadoop.version}</version>
        <exclusions>
          <exclusion>
            <groupId>ch.qos.reload4j</groupId>
            <artifactId>reload4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.github.pjfanning</groupId>
            <artifactId>jersey-json</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-core</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-servlet</artifactId>
          </exclusion>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
          <exclusion>
            <groupId>dnsjava</groupId>
            <artifactId>dnsjava</artifactId>
          </exclusion>
          <exclusion>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-client</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-recipes</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-auth</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.kerby</groupId>
            <artifactId>kerb-core</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-util</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-webapp</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-reload4j</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.parquet</groupId>
        <artifactId>parquet-column</artifactId>
        <version>${parquet.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.parquet</groupId>
        <artifactId>parquet-common</artifactId>
        <version>${parquet.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.parquet</groupId>
        <artifactId>parquet-hadoop</artifactId>
        <version>${parquet.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.yetus</groupId>
        <artifactId>audience-annotations</artifactId>
        <version>${yetus.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk18on</artifactId>
        <version>${bouncycastle.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk18on</artifactId>
        <version>${bouncycastle.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>${codehaus.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-jaxrs</artifactId>
        <version>${codehaus.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-xc</artifactId>
        <version>${codehaus.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jettison</groupId>
        <artifactId>jettison</artifactId>
        <version>1.5.4</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.woodstox</groupId>
        <artifactId>stax2-api</artifactId>
        <version>4.2.1</version>
      </dependency>
      <dependency>
        <groupId>org.objenesis</groupId>
        <artifactId>objenesis</artifactId>
        <version>${objenesis.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.xerial.snappy</groupId>
        <artifactId>snappy-java</artifactId>
        <version>${snappy.version}</version>
      </dependency>

      <!--JUnit so that we can make some basic unit tests-->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy-agent</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>3.7.7</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <!--All of our needed dependencies-->
  <dependencies>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <!--Jackson Databind api-->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <!--https://mvnrepository.com/artifact/com.github.ben-manes.caffeine/caffeine-->
    <!--We need to use 2.x version, which is compatible with Java 8-->
    <dependency>
      <groupId>com.github.ben-manes.caffeine</groupId>
      <artifactId>caffeine</artifactId>
      <version>2.9.3</version>
      <exclusions>
        <!--Dependencies are excluded because they are causing enforcer failures (they are already pulled in by Guava)-->
        <exclusion>
          <groupId>com.google.errorprone</groupId>
          <artifactId>error_prone_annotations</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.checkerframework</groupId>
          <artifactId>checker-qual</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <!--jwt token for key pair authentication with GS-->
    <dependency>
      <groupId>com.nimbusds</groupId>
      <artifactId>nimbus-jose-jwt</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
    </dependency>

    <!--https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-core-->
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-core</artifactId>
      <version>4.1.22</version>
    </dependency>

    <!--https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-jmx-->
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-jmx</artifactId>
      <version>4.1.22</version>
    </dependency>

    <!--https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-jvm-->
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-jvm</artifactId>
      <version>4.1.22</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-common</artifactId>
    </dependency>
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy-agent</artifactId>
    </dependency>
    <!--Snowflake JDBC used to connect to the service-->
    <dependency>
      <groupId>net.snowflake</groupId>
      <artifactId>snowflake-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
    </dependency>
    <!--https://mvnrepository.com/artifact/org.apache.parquet/parquet-hadoop-->
    <dependency>
      <groupId>org.apache.parquet</groupId>
      <artifactId>parquet-column</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.parquet</groupId>
      <artifactId>parquet-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.parquet</groupId>
      <artifactId>parquet-hadoop</artifactId>
    </dependency>

    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk18on</artifactId>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
      <scope>runtime</scope>
    </dependency>

    <!--JUnit so that we can make some basic unit tests-->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito2</artifactId>
      <version>2.0.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-core</artifactId>
      <version>2.0.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>2.0.2</version>
      <scope>test</scope>
    </dependency>
    <!--Change the 'test' scope to 'runtime' to enable console logging in examples-->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>${project.artifactId}</finalName>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${license.processing.resourcesRoot}</directory>
      </resource>
    </resources>

    <!--disable default maven deploy plugin since we are using gpg:sign-and-deploy-file-->
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M3</version>
          <dependencies>
            <dependency>
              <groupId>com.google.cloud.tools</groupId>
              <artifactId>linkage-checker-enforcer-rules</artifactId>
              <version>1.5.13</version>
            </dependency>
            <dependency>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>extra-enforcer-rules</artifactId>
              <version>1.3</version>
              <exclusions>
                <exclusion>
                  <groupId>org.eclipse.aether</groupId>
                  <artifactId>aether-util</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
          </dependencies>
        </plugin>

        <!--Need to define the maven-failsafe-plugin here-->
        <!--http://maven.apache.org/surefire/maven-failsafe-plugin/plugin-info.html-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>3.0.0-M5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco.version}</version>
          <configuration>
            <skip>${jacoco.skip.instrument}</skip>
            <excludes>
              <exclude>**/*SnowflakeStreamingIngestExample*</exclude>
              <exclude>**/*SnowflakeIngestBasicExample*</exclude>
              <exclude>**/*IngestExampleHelper*</exclude>
            </excludes>
          </configuration>
          <executions>
            <execution>
              <id>pre-unit-test</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <destFile>target/jacoco-ut.exec</destFile>
              </configuration>
            </execution>
            <execution>
              <id>post-unit-test</id>
              <goals>
                <goal>report</goal>
              </goals>
              <phase>test</phase>
              <configuration>
                <dataFile>target/jacoco-ut.exec</dataFile>
                <outputDirectory>target/jacoco-ut</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.github.ekryd.sortpom</groupId>
        <artifactId>sortpom-maven-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <createBackupFile>false</createBackupFile>
          <expandEmptyElements>false</expandEmptyElements>
          <indentSchemaLocation>true</indentSchemaLocation>
          <sortDependencies>scope,groupId,artifactId</sortDependencies>
          <sortDependencyExclusions>groupId,artifactId</sortDependencyExclusions>
          <sortExecutions>true</sortExecutions>
          <sortModules>true</sortModules>
          <sortPlugins>groupId,artifactId</sortPlugins>
          <sortProperties>true</sortProperties>
          <verifyFail>stop</verifyFail>
          <verifyFailOn>strict</verifyFailOn>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>verify</goal>
            </goals>
            <phase>validate</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <mainClass>net.snowflake.ingest.SimpleIngestManager</mainClass>
            </manifest>
          </archive>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <inherited>true</inherited>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <failOnWarning>true</failOnWarning>
              <ignoreNonCompile>true</ignoreNonCompile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-best-practices</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <banDuplicateClasses>
                  <findAllDuplicates>true</findAllDuplicates>
                  <ignoreWhenIdentical>true</ignoreWhenIdentical>
                </banDuplicateClasses>
                <banDuplicatePomDependencyVersions />
                <bannedDependencies />
                <dependencyConvergence />
                <requireUpperBoundDeps />
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.5</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
              <source>8</source>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <excludes>
            <exclude>**/TestSimpleIngestLocal.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.0.1</version>
        <configuration>
          <errorRemedy>failFast</errorRemedy>
          <!--The list of allowed licenses. If you see the build failing due to "There are some forbidden licenses used, please
                              check your dependencies", verify the conditions of the license and add the reference to it here.-->
          <includedLicenses>
            <includedLicense>Apache License 2.0</includedLicense>
            <includedLicense>BSD 2-Clause License</includedLicense>
            <includedLicense>3-Clause BSD License</includedLicense>
            <includedLicense>The MIT License</includedLicense>
            <includedLicense>EDL 1.0</includedLicense>
            <includedLicense>The Go license</includedLicense>
            <includedLicense>Bouncy Castle Licence</includedLicense>
          </includedLicenses>
          <excludedScopes>test,provided,system</excludedScopes>
          <failOnBlacklist>true</failOnBlacklist>
          <licenseMerges>
            <licenseMerge>Apache License 2.0
                            |The Apache License, Version 2.0
                            |The Apache Software License, Version 2.0
                            |Apache-2.0
                            |Apache License, Version 2.0
                            |Apache 2.0
                            |Apache License V2.0</licenseMerge>
            <licenseMerge>BSD 2-Clause License
                            |The BSD License</licenseMerge>
            <licenseMerge>The MIT License|MIT License</licenseMerge>
          </licenseMerges>
        </configuration>
        <executions>
          <execution>
            <id>add-third-party</id>
            <goals>
              <goal>add-third-party</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>checkLinkageErrors</id>
      <activation>
        <property>
          <!--Only check linkage errors for unshaded builds-->
          <name>not-shadeDep</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-linkage-checker</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <rules>
                    <LinkageCheckerRule implementation="com.google.cloud.tools.dependencies.enforcer.LinkageCheckerRule">
                      <reportOnlyReachable>true</reportOnlyReachable>
                      <exclusionFile>${basedir}/linkage-checker-exclusion-rules.xml</exclusionFile>
                      <level>WARN</level>
                    </LinkageCheckerRule>
                    <bannedDependencies>
                      <excludes>
                        <!--JUnit 4 is not allowed on the classpath to prevent its accidental use-->
                        <!--<exclude>junit:junit</exclude>-->
                      </excludes>
                    </bannedDependencies>
                  </rules>
                </configuration>
              </execution>

            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>
    <profile>
      <id>checkShadedContent</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>check-shaded-content</id>
                <goals>
                  <goal>exec</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <executable>${basedir}/scripts/check_content.sh</executable>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>shadeDep</id>
      <activation>
        <property>
          <name>!not-shadeDep</name>
        </property>
      </activation>
      <build>
        <plugins>
          <!--Copy all project dependencies to target/dependency-jars. License processing Python script will look here for
                              license files of SDK dependencies.-->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-dependencies</id>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <phase>generate-resources</phase>
                <configuration>
                  <outputDirectory>${license.processing.dependencyJarsDir}</outputDirectory>
                  <overWriteReleases>false</overWriteReleases>
                  <overWriteSnapshots>false</overWriteSnapshots>
                  <overWriteIfNewer>true</overWriteIfNewer>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!--Compile the list of SDK dependencies in 'compile' and 'runtime' scopes.
                              This list is an entry point for the license processing python script.-->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.6.0</version>
            <configuration>
              <includeScope>runtime</includeScope>
              <outputFile>${license.processing.dependencyListFile}</outputFile>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>list</goal>
                </goals>
                <phase>generate-resources</phase>
              </execution>
            </executions>
          </plugin>

          <!--Relocate all dependencies to internal to solve dependency conflict problem-->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.4.1</version>
            <configuration>
              <artifactSet>
                <excludes>
                  <exclude>net.snowflake:snowflake-jdbc</exclude>
                  <exclude>org.slf4j:slf4j-api</exclude>
                </excludes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.nimbusds</pattern>
                  <shadedPattern>${shadeBase}.com.nimbusds</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.bouncycastle</pattern>
                  <shadedPattern>${shadeBase}.org.bouncycastle</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>net.jcip</pattern>
                  <shadedPattern>${shadeBase}.net.jcip</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>net.minidev</pattern>
                  <shadedPattern>${shadeBase}.net.minidev</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.objectweb</pattern>
                  <shadedPattern>${shadeBase}.org.objectweb</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml</pattern>
                  <shadedPattern>${shadeBase}.fasterxml</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache</pattern>
                  <shadedPattern>${shadeBase}.apache</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.xbill</pattern>
                  <shadedPattern>${shadeBase}.org.xbill</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.xerial</pattern>
                  <shadedPattern>${shadeBase}.org.xerial</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.netty</pattern>
                  <shadedPattern>${shadeBase}.io.netty</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>${shadeBase}.com.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.github.benmanes</pattern>
                  <shadedPattern>${shadeBase}.com.github.benmanes</shadedPattern>
                </relocation>
                <!--shaded.parquet contains dependencies shaded in parquet itself. Here we are shading it for the second time-->
                <relocation>
                  <pattern>shaded.parquet</pattern>
                  <shadedPattern>${shadeBase}.shaded.parquet</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.codehaus</pattern>
                  <shadedPattern>${shadeBase}.org.codehaus</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.jcraft</pattern>
                  <shadedPattern>${shadeBase}.com.jcraft</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse</pattern>
                  <shadedPattern>${shadeBase}.org.eclipse</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.checkerframework</pattern>
                  <shadedPattern>${shadeBase}.org.checkerframework</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.codahale</pattern>
                  <shadedPattern>${shadeBase}.com.codahale</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.ctc</pattern>
                  <shadedPattern>${shadeBase}.com.ctc</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.github.luben</pattern>
                  <shadedPattern>${shadeBase}.com.github.luben</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.thoughtworks</pattern>
                  <shadedPattern>${shadeBase}.com.thoughtworks</shadedPattern>
                </relocation>
                <!--This belongs to org.apache.arrow:arrow-vector-->
                <relocation>
                  <pattern>codegen</pattern>
                  <shadedPattern>${shadeBase}.codegen</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>javax.annotation</pattern>
                  <shadedPattern>${shadeBase}.javax.annotation</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>javax.activation</pattern>
                  <shadedPattern>${shadeBase}.javax.activation</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.airlift.compress</pattern>
                  <shadedPattern>${shadeBase}.io.airlift.compress</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>assets/org/apache/commons/math3/exception/util/LocalizedFormats_fr.properties</exclude>
                    <exclude>about.html</exclude>
                    <exclude>mozilla/public-suffix-list.txt</exclude>

                    <exclude>META-INF/LICENSE*</exclude>
                    <exclude>META-INF/NOTICE*</exclude>
                    <exclude>META-INF/DEPENDENCIES</exclude>
                    <exclude>META-INF/maven/**</exclude>
                    <exclude>META-INF/services/com.fasterxml.*</exclude>
                    <exclude>META-INF/*.xml</exclude>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>google/protobuf/**/*.proto</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>commons-logging:commons-logging</artifact>
                  <excludes>
                    <exclude>org/apache/commons/logging/impl/AvalonLogger.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.slf4j:slf4j-simple</artifact>
                  <excludes>
                    <exclude>org/slf4j/**</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer" />
              </transformers>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>shade</goal>
                </goals>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>
          <!--Plugin executes license processing Python script, which copies third party license files into the directory
                              target/generated-licenses-info/META-INF/third-party-licenses, which is then included in the shaded JAR.-->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>process-third-party-licenses</id>
                <goals>
                  <goal>exec</goal>
                </goals>
                <phase>generate-resources</phase>
                <configuration>
                  <executable>python3</executable>
                  <arguments>
                    <argument>${project.basedir}/scripts/process_licenses.py</argument>
                    <argument>${license.processing.dependencyListFile}</argument>
                    <argument>${license.processing.dependencyJarsDir}</argument>
                    <argument>${license.processing.targetDir}</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ossrh-deploy</id>
      <activation>
        <property>
          <name>ossrh-deploy</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <goals>
                  <goal>sign-and-deploy-file</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                  <file>target/${project.artifactId}.jar</file>
                  <repositoryId>ossrh</repositoryId>
                  <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                  <pomFile>generated_public_pom.xml</pomFile>
                  <javadoc>target/${project.artifactId}-javadoc.jar</javadoc>
                  <sources>target/${project.artifactId}-sources.jar</sources>
                  <keyname>${env.GPG_KEY_ID}</keyname>
                  <passphrase>${env.GPG_KEY_PASSPHRASE}</passphrase>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>snapshot-deploy</id>
      <activation>
        <property>
          <name>snapshot-deploy</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <goals>
                  <goal>sign-and-deploy-file</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                  <file>target/${project.artifactId}.jar</file>
                  <repositoryId>snapshot</repositoryId>
                  <url>https://nexus.int.snowflakecomputing.com/repository/Snapshots/</url>
                  <pomFile>generated_public_pom.xml</pomFile>
                  <javadoc>target/${project.artifactId}-javadoc.jar</javadoc>
                  <sources>target/${project.artifactId}-sources.jar</sources>
                  <keyname>${env.GPG_KEY_ID}</keyname>
                  <passphrase>${env.GPG_KEY_PASSPHRASE}</passphrase>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ghActionsIT</id>
      <activation>
        <property>
          <name>ghActionsIT</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                </goals>
              </execution>
              <execution>
                <id>verify_github_actions_it</id>
                <goals>
                  <goal>verify</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco.version}</version>
            <configuration>
              <skip>${jacoco.skip.instrument}</skip>
            </configuration>
            <executions>
              <execution>
                <id>pre-unit-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <destFile>target/jacoco-ut.exec</destFile>
                </configuration>
              </execution>
              <execution>
                <id>post-unit-test</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <phase>test</phase>
                <configuration>
                  <dataFile>target/jacoco-ut.exec</dataFile>
                  <outputDirectory>target/jacoco-ut</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>pre-integration-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <phase>pre-integration-test</phase>
                <configuration>
                  <destFile>target/jacoco-it.exec</destFile>
                </configuration>
              </execution>
              <execution>
                <id>post-integration-test</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <phase>post-integration-test</phase>
                <configuration>
                  <dataFile>target/jacoco-it.exec</dataFile>
                  <outputDirectory>target/jacoco-it</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>