diff --git a/pom.xml b/pom.xml index 8f3586c0e..758f9f727 100644 --- a/pom.xml +++ b/pom.xml @@ -1,1507 +1,1507 @@ -<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>net.snowflake</groupId> - <artifactId>snowflake-jdbc-parent</artifactId> - <version>3.21.1-SNAPSHOT</version> - <relativePath>./parent-pom.xml</relativePath> - </parent> - - <!-- Maven complains about using property here, but it makes install and deploy process easier to override final package names and localization --> - <artifactId>${artifactId}</artifactId> - <version>3.21.1-SNAPSHOT</version> - <packaging>jar</packaging> - - <name>${artifactId}</name> - <url>https://github.com/snowflakedb/snowflake-jdbc</url> - - <scm> - <connection>scm:git:https://github.com/snowflakedb/snowflake-jdbc.git</connection> - <url>https://github.com/snowflakedb/snowflake-jdbc</url> - </scm> - - <properties> - <artifactId>snowflake-jdbc</artifactId> - </properties> - - <dependencies> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcpkix-jdk18on</artifactId> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcprov-jdk18on</artifactId> - </dependency> - <dependency> - <groupId>org.bouncycastle</groupId> - <artifactId>bcutil-jdk18on</artifactId> - </dependency> - </dependencies> - - <build> - <finalName>${project.artifactId}</finalName> - <resources> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - </resource> - </resources> - <pluginManagement> - <plugins> - <plugin> - <groupId>com.github.ekryd.sortpom</groupId> - <artifactId>sortpom-maven-plugin</artifactId> - <version>${version.plugin.sortpom}</version> - </plugin> - <plugin> - <groupId>com.github.siom79.japicmp</groupId> - <artifactId>japicmp-maven-plugin</artifactId> - <version>${version.plugin.japicmp}</version> - </plugin> - <plugin> - <groupId>com.spotify.fmt</groupId> - <artifactId>fmt-maven-plugin</artifactId> - <version>${version.plugin.fmt}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <version>${version.plugin.antrun}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>${version.plugin.checkstyle}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <version>${version.plugin.clean}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${version.plugin.compiler}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>${version.plugin.dependency}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> - <version>${version.plugin.deploy}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <version>${version.plugin.enforcer}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <version>${version.plugin.failsafe}</version> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit-platform</artifactId> - <version>${version.plugin.surefire}</version> - </dependency> - </dependencies> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-gpg-plugin</artifactId> - <version>${version.plugin.gpg}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>${version.plugin.install}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>${version.plugin.jar}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>${version.plugin.javadoc}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>${version.plugin.projectinforeports}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>${version.plugin.shade}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <version>${version.plugin.source}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>${version.plugin.surefire}</version> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit-platform</artifactId> - <version>${version.plugin.surefire}</version> - </dependency> - </dependencies> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>buildnumber-maven-plugin</artifactId> - <version>${version.plugin.buildnumber}</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>${version.plugin.exec}</version> - </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${version.plugin.jacoco}</version> - </plugin> - </plugins> - </pluginManagement> - <plugins> - <plugin> - <groupId>com.github.ekryd.sortpom</groupId> - <artifactId>sortpom-maven-plugin</artifactId> - <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> - <sortProperties>true</sortProperties> - <verifyFail>stop</verifyFail> - <verifyFailOn>strict</verifyFailOn> - </configuration> - <executions> - <execution> - <goals> - <goal>verify</goal> - </goals> - <phase>validate</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>com.github.siom79.japicmp</groupId> - <artifactId>japicmp-maven-plugin</artifactId> - <configuration> - <parameter> - <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications> - <ignoreMissingClasses>false</ignoreMissingClasses> - <oldVersionPattern>\d+\.\d+\.\d+</oldVersionPattern> - <includes> - <include>com.snowflake</include> - <include>net.snowflake</include> - </includes> - <excludes> - <exclude>@net.snowflake.client.core.SnowflakeJdbcInternalApi</exclude> - <exclude>${shadeBase}</exclude> - </excludes> - </parameter> - </configuration> - <executions> - <execution> - <id>japicmp</id> - <goals> - <goal>cmp</goal> - </goals> - <phase>verify</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <excludeDefaultDirectories/> - <filesets> - <fileset> - <directory>lib</directory> - <includes> - <include>*.jar</include> - </includes> - </fileset> - </filesets> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <showDeprecation>true</showDeprecation> - <showWarnings>true</showWarnings> - <executable>javac</executable> - <fork>true</fork> - <source>8</source> - <target>8</target> - <compilerArgs> - <arg>-Xlint:all,-path</arg> - </compilerArgs> - </configuration> - <executions> - <execution> - <id>default-testCompile</id> - <goals> - <goal>testCompile</goal> - </goals> - <phase>test-compile</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>analyze</id> - <goals> - <goal>analyze-only</goal> - </goals> - <configuration> - <failOnWarning>true</failOnWarning> - <ignoreNonCompile>true</ignoreNonCompile> - <ignoredUnusedDeclaredDependencies> - <ignoredUnusedDeclaredDependency>javax.servlet:javax.servlet-api</ignoredUnusedDeclaredDependency> - </ignoredUnusedDeclaredDependencies> - </configuration> - </execution> - <execution> - <id>install-jar</id> - <goals> - <goal>copy</goal> - </goals> - <phase>install</phase> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>lib</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <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> - <executions> - <execution> - <id>enforce-best-practices</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <banDuplicateClasses> - <findAllDuplicates>true</findAllDuplicates> - <ignoreWhenIdentical>true</ignoreWhenIdentical> - <dependencies> - <dependency> - <artifactId>arrow-memory-unsafe</artifactId> - <ignoreClasses> - <ignoreClass>org.apache.arrow.memory.DefaultAllocationManagerFactory</ignoreClass> - </ignoreClasses> - </dependency> - </dependencies> - </banDuplicateClasses> - <banDuplicatePomDependencyVersions/> - <bannedDependencies/> - <dependencyConvergence/> - <requireUpperBoundDeps/> - </rules> - </configuration> - </execution> - <execution> - <id>enforce-maven</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireMavenVersion> - <version>${version.maven}</version> - </requireMavenVersion> - </rules> - </configuration> - </execution> - <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>linkage-checker-exclusion-rules.xml</exclusionFile> - </LinkageCheckerRule> - </rules> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <executions> - <execution> - <id>install-arrow-format</id> - <goals> - <goal>install-file</goal> - </goals> - <phase>validate</phase> - <configuration> - <file>${project.basedir}/dependencies/arrow-format-${arrow.version}.jar</file> - <groupId>org.apache.arrow</groupId> - <artifactId>arrow-format</artifactId> - <version>${arrow.version}</version> - <packaging>jar</packaging> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-arrow-memory-core</id> - <goals> - <goal>install-file</goal> - </goals> - <phase>validate</phase> - <configuration> - <file>${project.basedir}/dependencies/arrow-memory-core-${arrow.version}.jar</file> - <groupId>org.apache.arrow</groupId> - <artifactId>arrow-memory-core</artifactId> - <version>${arrow.version}</version> - <packaging>jar</packaging> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-arrow-memory-netty-buffer-patch</id> - <goals> - <goal>install-file</goal> - </goals> - <phase>validate</phase> - <configuration> - <file>${project.basedir}/dependencies/arrow-memory-netty-buffer-patch-${arrow.version}.jar</file> - <groupId>org.apache.arrow</groupId> - <artifactId>arrow-memory-netty-buffer-patch</artifactId> - <version>${arrow.version}</version> - <packaging>jar</packaging> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-arrow-memory-pom</id> - <goals> - <goal>install-file</goal> - </goals> - <phase>validate</phase> - <configuration> - <file>${project.basedir}/dependencies/arrow-memory-${arrow.version}.pom</file> - <groupId>org.apache.arrow</groupId> - <artifactId>arrow-memory</artifactId> - <version>${arrow.version}</version> - <packaging>pom</packaging> - <generatePom>true</generatePom> - </configuration> - </execution> - - <execution> - <id>install-arrow-memory-unsafe</id> - <goals> - <goal>install-file</goal> - </goals> - <phase>validate</phase> - <configuration> - <file>${project.basedir}/dependencies/arrow-memory-unsafe-${arrow.version}.jar</file> - <groupId>org.apache.arrow</groupId> - <artifactId>arrow-memory-unsafe</artifactId> - <version>${arrow.version}</version> - <packaging>jar</packaging> - <generatePom>true</generatePom> - </configuration> - </execution> - - <execution> - <id>install-arrow-vector</id> - <goals> - <goal>install-file</goal> - </goals> - <phase>validate</phase> - <configuration> - <file>${project.basedir}/dependencies/arrow-vector-${arrow.version}.jar</file> - <groupId>org.apache.arrow</groupId> - <artifactId>arrow-vector</artifactId> - <version>${arrow.version}</version> - <packaging>jar</packaging> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-tika-core</id> - <goals> - <goal>install-file</goal> - </goals> - <phase>validate</phase> - <configuration> - <file>${project.basedir}/dependencies/tika-core-${tika.version}.jar</file> - <groupId>org.apache.tika</groupId> - <artifactId>tika-core</artifactId> - <version>${tika.version}</version> - <packaging>jar</packaging> - <generatePom>true</generatePom> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifest> - <mainClass>net.snowflake.client.jdbc.SnowflakeDriver</mainClass> - <addDefaultImplementationEntries>true</addDefaultImplementationEntries> - </manifest> - </archive> - </configuration> - <executions> - <execution> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <configuration> - <source>8</source> - <overview>${project.basedir}/src/main/javadoc/overview.html</overview> - <stylesheet>java</stylesheet> - <helpfile>${project.basedir}/src/main/javadoc/licenses.html</helpfile> - </configuration> - <executions> - <execution> - <id>attach-javadocs</id> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <executions> - <execution> - <id>attach-sources</id> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <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> - </executions> - </plugin> - </plugins> - </build> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-project-info-reports-plugin</artifactId> - </plugin> - </plugins> - </reporting> - - <profiles> - <profile> - <id>check-style</id> - <build> - <plugins> - <plugin> - <groupId>com.spotify.fmt</groupId> - <artifactId>fmt-maven-plugin</artifactId> - <executions> - <execution> - <id>fmt</id> - <goals> - <goal>check</goal> - </goals> - <phase>validate</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <checkstyleRules> - <module name="Checker"> - <module name="TreeWalker"> - <module name="AvoidStarImport"/> - <module name="NeedBraces"/> - </module> - </module> - </checkstyleRules> - <consoleOutput>true</consoleOutput> - <failsOnError>true</failsOnError> - <includeTestSourceDirectory>true</includeTestSourceDirectory> - <violationSeverity>warning</violationSeverity> - </configuration> - <executions> - <execution> - <id>checkstyle</id> - <goals> - <goal>check</goal> - </goals> - <phase>validate</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>thin-jar</id> - <activation> - <property> - <name>thin-jar</name> - </property> - </activation> - <properties> - <artifactId>snowflake-jdbc-thin</artifactId> - </properties> - <build> - <plugins> - <plugin> - <!-- google linkage checker doesn't work well with shaded jar, disable the check in this case for now --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <executions> - <execution> - <id>enforce-linkage-checker</id> - <goals> - <goal>enforce</goal> - </goals> - <phase>none</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <configuration/> - <executions> - <execution> - <goals> - <goal>shade</goal> - </goals> - <phase>package</phase> - <configuration> - <artifactSet> - <includes> - <include>net.snowflake:snowflake-common</include> - <include>org.apache.arrow:*</include> - <include>org.apache.tika:tika-core</include> - <include>io.netty:*</include> - </includes> - </artifactSet> - <relocations> - <!-- We list only packages that we need to include form dependencies + snowflake-common--> - <relocation> - <pattern>net.snowflake.common</pattern> - <shadedPattern>${shadeBase}.snowflake.common</shadedPattern> - </relocation> - <relocation> - <pattern>mozilla</pattern> - <shadedPattern>${shadeBase}.mozilla</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.arrow</pattern> - <shadedPattern>${shadeBase}.apache.arrow</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.tika</pattern> - <shadedPattern>${shadeBase}.apache.tika</shadedPattern> - </relocation> - <!-- io.netty are dependencies for arrow and arrow packages have some of the io.netty classes internally --> - <relocation> - <pattern>io.netty</pattern> - <shadedPattern>${shadeBase}.io.netty</shadedPattern> - </relocation> - </relocations> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <exclude>META-INF/LICENSE*</exclude> - <exclude>META-INF/NOTICE*</exclude> - <exclude>META-INF/DEPENDENCIES</exclude> - <exclude>META-INF/maven/**</exclude> - <exclude>META-INF/*.xml</exclude> - <exclude>META-INF/*.SF</exclude> - <exclude>META-INF/*.DSA</exclude> - <exclude>META-INF/*.RSA</exclude> - <exclude>.netbeans_automatic_build</exclude> - <exclude>git.properties</exclude> - <exclude>arrow-git.properties</exclude> - <exclude>google-http-client.properties</exclude> - <exclude>storage.v1.json</exclude> - <!-- This is just a documentation file, not needed--> - <exclude>pipes-fork-server-default-log4j2.xml</exclude> - <exclude>dependencies.properties</exclude> - <exclude>pipes-fork-server-default-log4j2.xml</exclude> - </excludes> - </filter> - <filter> - <artifact>org.apache.arrow:arrow-vector</artifact> - <excludes> - <!-- codegen directory is used to generate java code for arrow vector package. Excludes them since we only need class file --> - <exclude>codegen/**</exclude> - </excludes> - </filter> - </filters> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> - <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/io.netty.versions.properties</resource> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>buildnumber-maven-plugin</artifactId> - <configuration> - <timestampFormat>yyyyMMddHHmmss</timestampFormat> - <timestampPropertyName>buildNumber.timestamp</timestampPropertyName> - <doCheck>false</doCheck> - <revisionOnScmFailure/> - <doUpdate>false</doUpdate> - <!--- Note for those who come later. If you specify "buildNumber" in the items field, it becomes an incrementing buildNumber - AFAIK (and I spent a lot of time on this) it is impossible to get the SCM rev number and incrementing build number at the same time --> - </configuration> - <executions> - <execution> - <goals> - <goal>create-timestamp</goal> - </goals> - <phase>package</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>self-contained-jar</id> - <activation> - <property> - <name>!not-self-contained-jar</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <!-- google linkage checker doesn't work well with shaded jar, disable the check in this case for now --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-enforcer-plugin</artifactId> - <executions> - <execution> - <id>enforce-linkage-checker</id> - <goals> - <goal>enforce</goal> - </goals> - <phase>none</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <configuration/> - <executions> - <execution> - <goals> - <goal>shade</goal> - </goals> - <phase>package</phase> - <configuration> - <relocations> - <relocation> - <pattern>mozilla</pattern> - <shadedPattern>${shadeBase}.mozilla</shadedPattern> - </relocation> - <relocation> - <pattern>net.snowflake.common</pattern> - <shadedPattern>${shadeBase}.snowflake.common</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache</pattern> - <shadedPattern>${shadeBase}.apache</shadedPattern> - <excludes> - <exclude>org.apache.log4j.*</exclude> - </excludes> - </relocation> - <relocation> - <pattern>com.amazonaws</pattern> - <shadedPattern>${shadeBase}.amazonaws</shadedPattern> - </relocation> - <relocation> - <pattern>software.amazon.ion</pattern> - <shadedPattern>${shadeBase}.software.amazon.ion</shadedPattern> - </relocation> - <relocation> - <pattern>com.microsoft.azure</pattern> - <shadedPattern>${shadeBase}.microsoft.azure</shadedPattern> - </relocation> - <relocation> - <pattern>com.fasterxml</pattern> - <shadedPattern>${shadeBase}.fasterxml</shadedPattern> - </relocation> - <relocation> - <pattern>com.google</pattern> - <shadedPattern>${shadeBase}.google</shadedPattern> - </relocation> - <!-- google packages should be relocated explicitly to avoid problems with properties files renaming --> - <relocation> - <pattern>google.api</pattern> - <shadedPattern>${shadeBase}.google.api</shadedPattern> - </relocation> - <relocation> - <pattern>google.apps</pattern> - <shadedPattern>${shadeBase}.google.apps</shadedPattern> - </relocation> - <relocation> - <pattern>google.cloud</pattern> - <shadedPattern>${shadeBase}.google.cloud</shadedPattern> - </relocation> - <relocation> - <pattern>google.geo</pattern> - <shadedPattern>${shadeBase}.google.geo</shadedPattern> - </relocation> - <relocation> - <pattern>google.iam</pattern> - <shadedPattern>${shadeBase}.google.iam</shadedPattern> - </relocation> - <relocation> - <pattern>google.logging</pattern> - <shadedPattern>${shadeBase}.google.logging</shadedPattern> - </relocation> - <relocation> - <pattern>google.longrunning</pattern> - <shadedPattern>${shadeBase}.google.longrunning</shadedPattern> - </relocation> - <relocation> - <pattern>google.monitoring</pattern> - <shadedPattern>${shadeBase}.google.monitoring</shadedPattern> - </relocation> - <relocation> - <pattern>google.protobuf</pattern> - <shadedPattern>${shadeBase}.google.protobuf</shadedPattern> - </relocation> - <relocation> - <pattern>google.rpc</pattern> - <shadedPattern>${shadeBase}.google.rpc</shadedPattern> - </relocation> - <relocation> - <pattern>google.shopping</pattern> - <shadedPattern>${shadeBase}.google.shopping</shadedPattern> - </relocation> - <relocation> - <pattern>google.storage</pattern> - <shadedPattern>${shadeBase}.google.storage</shadedPattern> - </relocation> - <relocation> - <pattern>google.type</pattern> - <shadedPattern>${shadeBase}.google.type</shadedPattern> - </relocation> - <relocation> - <pattern>org.joda</pattern> - <shadedPattern>${shadeBase}.joda</shadedPattern> - </relocation> - <relocation> - <pattern>com.yammer</pattern> - <shadedPattern>${shadeBase}.yammer</shadedPattern> - </relocation> - <relocation> - <pattern>javax.servlet</pattern> - <shadedPattern>${shadeBase}.javax.servlet</shadedPattern> - </relocation> - <relocation> - <pattern>org.jsoup</pattern> - <shadedPattern>${shadeBase}.org.jsoup</shadedPattern> - </relocation> - <relocation> - <pattern>org.bouncycastle</pattern> - <shadedPattern>${shadeBase}.org.bouncycastle</shadedPattern> - </relocation> - <relocation> - <pattern>com.nimbusds</pattern> - <shadedPattern>${shadeBase}.com.nimbusds</shadedPattern> - </relocation> - <relocation> - <pattern>javax.annotation</pattern> - <shadedPattern>${shadeBase}.javax.annotation</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>io.netty</pattern> - <shadedPattern>${shadeBase}.io.netty</shadedPattern> - </relocation> - <relocation> - <pattern>com.carrotsearch</pattern> - <shadedPattern>${shadeBase}.com.carrotsearch</shadedPattern> - </relocation> - <relocation> - <pattern>io.opencensus</pattern> - <shadedPattern>${shadeBase}.opencensus</shadedPattern> - </relocation> - <relocation> - <pattern>io.opentelemetry</pattern> - <shadedPattern>${shadeBase}.opentelemetry</shadedPattern> - </relocation> - <relocation> - <pattern>org.threeten</pattern> - <shadedPattern>${shadeBase}.threeten</shadedPattern> - </relocation> - <relocation> - <pattern>io.grpc</pattern> - <shadedPattern>${shadeBase}.grpc</shadedPattern> - </relocation> - <relocation> - <pattern>META-INF.native.io_grpc_netty_shaded_netty_tcnative</pattern> - <shadedPattern>META-INF.native.${shadeNativeBase}_grpc_netty_shaded_netty_tcnative</shadedPattern> - </relocation> - <relocation> - <pattern>META-INF.native.libio_grpc_netty_shaded_netty_tcnative</pattern> - <shadedPattern>META-INF.native.lib${shadeNativeBase}_grpc_netty_shaded_netty_tcnative</shadedPattern> - </relocation> - <relocation> - <pattern>META-INF.native.io_grpc_netty_shaded_netty_transport_native_epoll</pattern> - <shadedPattern>META-INF.native.${shadeNativeBase}_grpc_netty_shaded_netty_transport_native_epoll</shadedPattern> - </relocation> - <relocation> - <pattern>META-INF.native.libio_grpc_netty_shaded_netty_transport_native_epoll</pattern> - <shadedPattern>META-INF.native.lib${shadeNativeBase}_grpc_netty_shaded_netty_transport_native_epoll</shadedPattern> - </relocation> - <relocation> - <pattern>org.checkerframework</pattern> - <shadedPattern>${shadeBase}.org.checkerframework</shadedPattern> - </relocation> - <relocation> - <pattern>org.codehaus</pattern> - <shadedPattern>${shadeBase}.org.codehaus</shadedPattern> - </relocation> - <relocation> - <pattern>io.perfmark</pattern> - <shadedPattern>${shadeBase}.io.perfmark</shadedPattern> - </relocation> - <relocation> - <pattern>org.conscrypt</pattern> - <shadedPattern>${shadeBase}.org.conscrypt</shadedPattern> - </relocation> - <relocation> - <pattern>conscrypt_openjdk_jni</pattern> - <shadedPattern>${shadeNativeBase}_conscrypt_openjdk_jni</shadedPattern> - </relocation> - <relocation> - <pattern>META-INF.native.conscrypt_openjdk_jni</pattern> - <shadedPattern>META-INF.native.${shadeNativeBase}_conscrypt_openjdk_jni</shadedPattern> - </relocation> - <relocation> - <pattern>META-INF.native.libconscrypt_openjdk_jni</pattern> - <shadedPattern>META-INF.native.lib${shadeNativeBase}_conscrypt_openjdk_jni</shadedPattern> - </relocation> - <relocation> - <pattern>opencensus</pattern> - <shadedPattern>${shadeBase}.opencensus</shadedPattern> - </relocation> - <relocation> - <pattern>grpc</pattern> - <shadedPattern>${shadeBase}.grpc</shadedPattern> - </relocation> - <relocation> - <pattern>android.annotation</pattern> - <shadedPattern>${shadeBase}.android.annotation</shadedPattern> - </relocation> - </relocations> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <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/versions/9/module-info.*</exclude> - <exclude>META-INF/*.xml</exclude> - <exclude>META-INF/*.SF</exclude> - <exclude>META-INF/*.DSA</exclude> - <exclude>META-INF/*.RSA</exclude> - <exclude>.netbeans_automatic_build</exclude> - <exclude>git.properties</exclude> - <exclude>arrow-git.properties</exclude> - <exclude>google-http-client.properties</exclude> - <exclude>storage.v1.json</exclude> - <!-- This is just a documentation file, not needed--> - <exclude>pipes-fork-server-default-log4j2.xml</exclude> - <exclude>dependencies.properties</exclude> - <exclude>pipes-fork-server-default-log4j2.xml</exclude> - </excludes> - </filter> - <filter> - <artifact>org.apache.arrow:arrow-vector</artifact> - <excludes> - <!-- codegen directory is used to generate java code for arrow vector package. Excludes them since we only need class file --> - <exclude>codegen/**</exclude> - </excludes> - </filter> - <filter> - <artifact>com.google.guava:guava</artifact> - <includes> - <include>com/google/common/io/**</include> - <include>com/google/common/base/**</include> - <include>com/google/common/hash/**</include> - <include>com/google/common/collect/**</include> - <include>com/google/common/graph/**</include> - <include>com/google/common/math/**</include> - <include>com/google/common/util/concurrent/**</include> - </includes> - </filter> - <filter> - <artifact>commons-logging:commons-logging</artifact> - <excludes> - <exclude>org/apache/commons/logging/impl/AvalonLogger.class</exclude> - </excludes> - </filter> - </filters> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> - <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/io.netty.versions.properties</resource> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <!-- relocate the META-INF/versions files manually due to the maven bug --> - <!-- https://issues.apache.org/jira/browse/MSHADE-406 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>repack</id> - <goals> - <goal>run</goal> - </goals> - <phase>package</phase> - <configuration> - <target> - <unzip dest="${project.build.directory}/relocate" src="${project.build.directory}/${project.build.finalName}.jar"/> - <mkdir dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> - <mkdir dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> - <mkdir dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/> - <mkdir dir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/> - <mkdir dir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> - <mkdir dir="${project.build.directory}/relocate/META-INF/versions/22/${relocationBase}"/> - <!-- org.bouncycastle.* packages are relocated to ${relocationBase}.org.bouncycastle.* --> - <move file="${project.build.directory}/relocate/META-INF/versions/9/org" todir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> - <move file="${project.build.directory}/relocate/META-INF/versions/11/org" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> - <move file="${project.build.directory}/relocate/META-INF/versions/15/org" todir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/> - <move file="${project.build.directory}/relocate/META-INF/versions/21/org" todir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> - <!-- com.fasterxml.* packages are relocated to ${relocationBase}.fasterxml.* --> - <move file="${project.build.directory}/relocate/META-INF/versions/11/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> - <move file="${project.build.directory}/relocate/META-INF/versions/17/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/> - <move file="${project.build.directory}/relocate/META-INF/versions/21/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> - <move file="${project.build.directory}/relocate/META-INF/versions/22/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/22/${relocationBase}"/> - <!-- io.opentelemetry.* packages are relocated to ${relocationBase}.io.opentelemetry.* --> - <move file="${project.build.directory}/relocate/META-INF/versions/9/io" todir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> - <zip basedir="${project.build.directory}/relocate" destfile="${project.build.directory}/${project.build.finalName}.jar"/> - <delete dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> - <delete dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> - <delete dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/> - <delete dir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/> - <delete dir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> - <delete dir="${project.build.directory}/relocate/META-INF/versions/22/${relocationBase}"/> - </target> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>buildnumber-maven-plugin</artifactId> - <configuration> - <timestampFormat>yyyyMMddHHmmss</timestampFormat> - <timestampPropertyName>buildNumber.timestamp</timestampPropertyName> - <doCheck>false</doCheck> - <revisionOnScmFailure/> - <doUpdate>false</doUpdate> - <!--- Note for those who come later. If you specify "buildNumber" in the items field, it becomes an incrementing buildNumber - AFAIK (and I spent a lot of time on this) it is impossible to get the SCM rev number and incrementing build number at the same time --> - </configuration> - <executions> - <execution> - <goals> - <goal>create-timestamp</goal> - </goals> - <phase>package</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>java-9</id> - <activation> - <jdk>(9,)</jdk> - </activation> - <build> - <plugins> - <plugin> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <argLine>--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine> - </configuration> - </plugin> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>${skip.unitTests}</skipTests> - <argLine>--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine> - </configuration> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>jenkinsIT</id> - <activation> - <property> - <name>jenkinsIT</name> - </property> - </activation> - <build> - <plugins> - <!-- - Downloading - 1. japicmp - 2. maven-dependency-plugin analyst - in jenkins node would cause http connection failure. Temporarily disable them. - --> - <plugin> - <groupId>com.github.siom79.japicmp</groupId> - <artifactId>japicmp-maven-plugin</artifactId> - <executions> - <execution> - <id>japicmp</id> - <goals> - <goal>cmp</goal> - </goals> - <phase>none</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>analyze</id> - <goals> - <goal>analyze-only</goal> - </goals> - <phase>none</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <test>UnitTestSuite</test> - <skipTests>${skip.unitTests}</skipTests> - </configuration> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit-platform</artifactId> - <version>${version.plugin.surefire}</version> - </dependency> - </dependencies> - <executions> - <execution> - <goals> - <goal>test</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>verify</goal> - </goals> - </execution> - <execution> - <id>DefaultIT</id> - <goals> - <goal>integration-test</goal> - </goals> - <configuration> - <systemPropertyVariables> - <net.snowflake.jdbc.loggerImpl>net.snowflake.client.log.JDK14Logger</net.snowflake.jdbc.loggerImpl> - <java.util.logging.config.file>${basedir}/src/test/resources/logging.properties</java.util.logging.config.file> - </systemPropertyVariables> - <test>${integrationTestSuites}</test> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <configuration> - <skip>${jacoco.skip.instrument}</skip> - </configuration> - <executions> - <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> - - <profile> - <id>check-content</id> - <activation> - <os> - <family>!windows</family> - </os> - <property> - <name>!thin-jar</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>${version.plugin.exec}</version> - <executions> - <execution> - <id>check-shaded-content</id> - <goals> - <goal>exec</goal> - </goals> - <phase>verify</phase> - <configuration> - <executable>${basedir}/ci/scripts/check_content.sh</executable> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - - <profile> - <id>check-content-thin</id> - <activation> - <os> - <family>!windows</family> - </os> - <property> - <name>thin-jar</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>${version.plugin.exec}</version> - <executions> - <execution> - <id>check-shaded-content</id> - <goals> - <goal>exec</goal> - </goals> - <phase>verify</phase> - <configuration> - <executable>${basedir}/ci/scripts/check_content.sh</executable> - <arguments> - <argument>-thin</argument> - </arguments> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>qa1IT</id> - <activation> - <property> - <name>qa1IT</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <includes> - <include>**/*IT.java</include> - </includes> - </configuration> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit-platform</artifactId> - <version>${version.plugin.surefire}</version> - </dependency> - </dependencies> - <executions> - <execution> - <goals> - <goal>verify</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>DellBoomi</id> - <activation> - <property> - <name>dellBoomiIT</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <includes> - <include>**/*IT.java</include> - </includes> - </configuration> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit-platform</artifactId> - <version>${version.plugin.surefire}</version> - </dependency> - </dependencies> - <executions> - <execution> - <goals> - <goal>verify</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>preprod3IT</id> - <activation> - <property> - <name>preprod3IT</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <includes> - <include>**/*IT.java</include> - </includes> - </configuration> - <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit-platform</artifactId> - <version>${version.plugin.surefire}</version> - </dependency> - </dependencies> - <executions> - <execution> - <goals> - <goal>verify</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>ossrh-deploy</id> - <activation> - <property> - <name>ossrhDeploy</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <artifactId>maven-deploy-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-gpg-plugin</artifactId> - <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> - </profiles> -</project> +<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>net.snowflake</groupId> + <artifactId>snowflake-jdbc-parent</artifactId> + <version>3.21.1-SNAPSHOT</version> + <relativePath>./parent-pom.xml</relativePath> + </parent> + + <!-- Maven complains about using property here, but it makes install and deploy process easier to override final package names and localization --> + <artifactId>${artifactId}</artifactId> + <version>3.21.1-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>${artifactId}</name> + <url>https://github.com/snowflakedb/snowflake-jdbc</url> + + <scm> + <connection>scm:git:https://github.com/snowflakedb/snowflake-jdbc.git</connection> + <url>https://github.com/snowflakedb/snowflake-jdbc</url> + </scm> + + <properties> + <artifactId>snowflake-jdbc</artifactId> + </properties> + + <dependencies> + <dependency> + <groupId>org.bouncycastle</groupId> + <artifactId>bcpkix-jdk18on</artifactId> + </dependency> + <dependency> + <groupId>org.bouncycastle</groupId> + <artifactId>bcprov-jdk18on</artifactId> + </dependency> + <dependency> + <groupId>org.bouncycastle</groupId> + <artifactId>bcutil-jdk18on</artifactId> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <resources> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + </resource> + </resources> + <pluginManagement> + <plugins> + <plugin> + <groupId>com.github.ekryd.sortpom</groupId> + <artifactId>sortpom-maven-plugin</artifactId> + <version>${version.plugin.sortpom}</version> + </plugin> + <plugin> + <groupId>com.github.siom79.japicmp</groupId> + <artifactId>japicmp-maven-plugin</artifactId> + <version>${version.plugin.japicmp}</version> + </plugin> + <plugin> + <groupId>com.spotify.fmt</groupId> + <artifactId>fmt-maven-plugin</artifactId> + <version>${version.plugin.fmt}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>${version.plugin.antrun}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>${version.plugin.checkstyle}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>${version.plugin.clean}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.plugin.compiler}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>${version.plugin.dependency}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>${version.plugin.deploy}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>${version.plugin.enforcer}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>${version.plugin.failsafe}</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${version.plugin.surefire}</version> + </dependency> + </dependencies> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <version>${version.plugin.gpg}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>${version.plugin.install}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>${version.plugin.jar}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>${version.plugin.javadoc}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>${version.plugin.projectinforeports}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>${version.plugin.shade}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>${version.plugin.source}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>${version.plugin.surefire}</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${version.plugin.surefire}</version> + </dependency> + </dependencies> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <version>${version.plugin.buildnumber}</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>${version.plugin.exec}</version> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${version.plugin.jacoco}</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>com.github.ekryd.sortpom</groupId> + <artifactId>sortpom-maven-plugin</artifactId> + <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> + <sortProperties>true</sortProperties> + <verifyFail>stop</verifyFail> + <verifyFailOn>strict</verifyFailOn> + </configuration> + <executions> + <execution> + <goals> + <goal>verify</goal> + </goals> + <phase>validate</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>com.github.siom79.japicmp</groupId> + <artifactId>japicmp-maven-plugin</artifactId> + <configuration> + <parameter> + <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications> + <ignoreMissingClasses>false</ignoreMissingClasses> + <oldVersionPattern>\d+\.\d+\.\d+</oldVersionPattern> + <includes> + <include>com.snowflake</include> + <include>net.snowflake</include> + </includes> + <excludes> + <exclude>@net.snowflake.client.core.SnowflakeJdbcInternalApi</exclude> + <exclude>${shadeBase}</exclude> + </excludes> + </parameter> + </configuration> + <executions> + <execution> + <id>japicmp</id> + <goals> + <goal>cmp</goal> + </goals> + <phase>verify</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <excludeDefaultDirectories/> + <filesets> + <fileset> + <directory>lib</directory> + <includes> + <include>*.jar</include> + </includes> + </fileset> + </filesets> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <showDeprecation>true</showDeprecation> + <showWarnings>true</showWarnings> + <executable>javac</executable> + <fork>true</fork> + <source>8</source> + <target>8</target> + <compilerArgs> + <arg>-Xlint:all,-path</arg> + </compilerArgs> + </configuration> + <executions> + <execution> + <id>default-testCompile</id> + <goals> + <goal>testCompile</goal> + </goals> + <phase>test-compile</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>analyze</id> + <goals> + <goal>analyze-only</goal> + </goals> + <configuration> + <failOnWarning>true</failOnWarning> + <ignoreNonCompile>true</ignoreNonCompile> + <ignoredUnusedDeclaredDependencies> + <ignoredUnusedDeclaredDependency>javax.servlet:javax.servlet-api</ignoredUnusedDeclaredDependency> + </ignoredUnusedDeclaredDependencies> + </configuration> + </execution> + <execution> + <id>install-jar</id> + <goals> + <goal>copy</goal> + </goals> + <phase>install</phase> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>lib</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <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> + <executions> + <execution> + <id>enforce-best-practices</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <banDuplicateClasses> + <findAllDuplicates>true</findAllDuplicates> + <ignoreWhenIdentical>true</ignoreWhenIdentical> + <dependencies> + <dependency> + <artifactId>arrow-memory-unsafe</artifactId> + <ignoreClasses> + <ignoreClass>org.apache.arrow.memory.DefaultAllocationManagerFactory</ignoreClass> + </ignoreClasses> + </dependency> + </dependencies> + </banDuplicateClasses> + <banDuplicatePomDependencyVersions/> + <bannedDependencies/> + <dependencyConvergence/> + <requireUpperBoundDeps/> + </rules> + </configuration> + </execution> + <execution> + <id>enforce-maven</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireMavenVersion> + <version>${version.maven}</version> + </requireMavenVersion> + </rules> + </configuration> + </execution> + <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>linkage-checker-exclusion-rules.xml</exclusionFile> + </LinkageCheckerRule> + </rules> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <executions> + <execution> + <id>install-arrow-format</id> + <goals> + <goal>install-file</goal> + </goals> + <phase>validate</phase> + <configuration> + <file>${project.basedir}/dependencies/arrow-format-${arrow.version}.jar</file> + <groupId>org.apache.arrow</groupId> + <artifactId>arrow-format</artifactId> + <version>${arrow.version}</version> + <packaging>jar</packaging> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-arrow-memory-core</id> + <goals> + <goal>install-file</goal> + </goals> + <phase>validate</phase> + <configuration> + <file>${project.basedir}/dependencies/arrow-memory-core-${arrow.version}.jar</file> + <groupId>org.apache.arrow</groupId> + <artifactId>arrow-memory-core</artifactId> + <version>${arrow.version}</version> + <packaging>jar</packaging> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-arrow-memory-netty-buffer-patch</id> + <goals> + <goal>install-file</goal> + </goals> + <phase>validate</phase> + <configuration> + <file>${project.basedir}/dependencies/arrow-memory-netty-buffer-patch-${arrow.version}.jar</file> + <groupId>org.apache.arrow</groupId> + <artifactId>arrow-memory-netty-buffer-patch</artifactId> + <version>${arrow.version}</version> + <packaging>jar</packaging> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-arrow-memory-pom</id> + <goals> + <goal>install-file</goal> + </goals> + <phase>validate</phase> + <configuration> + <file>${project.basedir}/dependencies/arrow-memory-${arrow.version}.pom</file> + <groupId>org.apache.arrow</groupId> + <artifactId>arrow-memory</artifactId> + <version>${arrow.version}</version> + <packaging>pom</packaging> + <generatePom>true</generatePom> + </configuration> + </execution> + + <execution> + <id>install-arrow-memory-unsafe</id> + <goals> + <goal>install-file</goal> + </goals> + <phase>validate</phase> + <configuration> + <file>${project.basedir}/dependencies/arrow-memory-unsafe-${arrow.version}.jar</file> + <groupId>org.apache.arrow</groupId> + <artifactId>arrow-memory-unsafe</artifactId> + <version>${arrow.version}</version> + <packaging>jar</packaging> + <generatePom>true</generatePom> + </configuration> + </execution> + + <execution> + <id>install-arrow-vector</id> + <goals> + <goal>install-file</goal> + </goals> + <phase>validate</phase> + <configuration> + <file>${project.basedir}/dependencies/arrow-vector-${arrow.version}.jar</file> + <groupId>org.apache.arrow</groupId> + <artifactId>arrow-vector</artifactId> + <version>${arrow.version}</version> + <packaging>jar</packaging> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-tika-core</id> + <goals> + <goal>install-file</goal> + </goals> + <phase>validate</phase> + <configuration> + <file>${project.basedir}/dependencies/tika-core-${tika.version}.jar</file> + <groupId>org.apache.tika</groupId> + <artifactId>tika-core</artifactId> + <version>${tika.version}</version> + <packaging>jar</packaging> + <generatePom>true</generatePom> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifest> + <mainClass>net.snowflake.client.jdbc.SnowflakeDriver</mainClass> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + </manifest> + </archive> + </configuration> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <source>8</source> + <overview>${project.basedir}/src/main/javadoc/overview.html</overview> + <stylesheet>java</stylesheet> + <helpfile>${project.basedir}/src/main/javadoc/licenses.html</helpfile> + </configuration> + <executions> + <execution> + <id>attach-javadocs</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <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> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + </plugin> + </plugins> + </reporting> + + <profiles> + <profile> + <id>check-style</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify.fmt</groupId> + <artifactId>fmt-maven-plugin</artifactId> + <executions> + <execution> + <id>fmt</id> + <goals> + <goal>check</goal> + </goals> + <phase>validate</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <checkstyleRules> + <module name="Checker"> + <module name="TreeWalker"> + <module name="AvoidStarImport"/> + <module name="NeedBraces"/> + </module> + </module> + </checkstyleRules> + <consoleOutput>true</consoleOutput> + <failsOnError>true</failsOnError> + <includeTestSourceDirectory>true</includeTestSourceDirectory> + <violationSeverity>warning</violationSeverity> + </configuration> + <executions> + <execution> + <id>checkstyle</id> + <goals> + <goal>check</goal> + </goals> + <phase>validate</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>thin-jar</id> + <activation> + <property> + <name>thin-jar</name> + </property> + </activation> + <properties> + <artifactId>snowflake-jdbc-thin</artifactId> + </properties> + <build> + <plugins> + <plugin> + <!-- google linkage checker doesn't work well with shaded jar, disable the check in this case for now --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>enforce-linkage-checker</id> + <goals> + <goal>enforce</goal> + </goals> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <configuration/> + <executions> + <execution> + <goals> + <goal>shade</goal> + </goals> + <phase>package</phase> + <configuration> + <artifactSet> + <includes> + <include>net.snowflake:snowflake-common</include> + <include>org.apache.arrow:*</include> + <include>org.apache.tika:tika-core</include> + <include>io.netty:*</include> + </includes> + </artifactSet> + <relocations> + <!-- We list only packages that we need to include form dependencies + snowflake-common--> + <relocation> + <pattern>net.snowflake.common</pattern> + <shadedPattern>${shadeBase}.snowflake.common</shadedPattern> + </relocation> + <relocation> + <pattern>mozilla</pattern> + <shadedPattern>${shadeBase}.mozilla</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.arrow</pattern> + <shadedPattern>${shadeBase}.apache.arrow</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.tika</pattern> + <shadedPattern>${shadeBase}.apache.tika</shadedPattern> + </relocation> + <!-- io.netty are dependencies for arrow and arrow packages have some of the io.netty classes internally --> + <relocation> + <pattern>io.netty</pattern> + <shadedPattern>${shadeBase}.io.netty</shadedPattern> + </relocation> + </relocations> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/LICENSE*</exclude> + <exclude>META-INF/NOTICE*</exclude> + <exclude>META-INF/DEPENDENCIES</exclude> + <exclude>META-INF/maven/**</exclude> + <exclude>META-INF/*.xml</exclude> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + <exclude>.netbeans_automatic_build</exclude> + <exclude>git.properties</exclude> + <exclude>arrow-git.properties</exclude> + <exclude>google-http-client.properties</exclude> + <exclude>storage.v1.json</exclude> + <!-- This is just a documentation file, not needed--> + <exclude>pipes-fork-server-default-log4j2.xml</exclude> + <exclude>dependencies.properties</exclude> + <exclude>pipes-fork-server-default-log4j2.xml</exclude> + </excludes> + </filter> + <filter> + <artifact>org.apache.arrow:arrow-vector</artifact> + <excludes> + <!-- codegen directory is used to generate java code for arrow vector package. Excludes them since we only need class file --> + <exclude>codegen/**</exclude> + </excludes> + </filter> + </filters> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/> + <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> + <resource>META-INF/io.netty.versions.properties</resource> + </transformer> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <configuration> + <timestampFormat>yyyyMMddHHmmss</timestampFormat> + <timestampPropertyName>buildNumber.timestamp</timestampPropertyName> + <doCheck>false</doCheck> + <revisionOnScmFailure/> + <doUpdate>false</doUpdate> + <!--- Note for those who come later. If you specify "buildNumber" in the items field, it becomes an incrementing buildNumber + AFAIK (and I spent a lot of time on this) it is impossible to get the SCM rev number and incrementing build number at the same time --> + </configuration> + <executions> + <execution> + <goals> + <goal>create-timestamp</goal> + </goals> + <phase>package</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>self-contained-jar</id> + <activation> + <property> + <name>!not-self-contained-jar</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <!-- google linkage checker doesn't work well with shaded jar, disable the check in this case for now --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>enforce-linkage-checker</id> + <goals> + <goal>enforce</goal> + </goals> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <configuration/> + <executions> + <execution> + <goals> + <goal>shade</goal> + </goals> + <phase>package</phase> + <configuration> + <relocations> + <relocation> + <pattern>mozilla</pattern> + <shadedPattern>${shadeBase}.mozilla</shadedPattern> + </relocation> + <relocation> + <pattern>net.snowflake.common</pattern> + <shadedPattern>${shadeBase}.snowflake.common</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache</pattern> + <shadedPattern>${shadeBase}.apache</shadedPattern> + <excludes> + <exclude>org.apache.log4j.*</exclude> + </excludes> + </relocation> + <relocation> + <pattern>com.amazonaws</pattern> + <shadedPattern>${shadeBase}.amazonaws</shadedPattern> + </relocation> + <relocation> + <pattern>software.amazon.ion</pattern> + <shadedPattern>${shadeBase}.software.amazon.ion</shadedPattern> + </relocation> + <relocation> + <pattern>com.microsoft.azure</pattern> + <shadedPattern>${shadeBase}.microsoft.azure</shadedPattern> + </relocation> + <relocation> + <pattern>com.fasterxml</pattern> + <shadedPattern>${shadeBase}.fasterxml</shadedPattern> + </relocation> + <relocation> + <pattern>com.google</pattern> + <shadedPattern>${shadeBase}.google</shadedPattern> + </relocation> + <!-- google packages should be relocated explicitly to avoid problems with properties files renaming --> + <relocation> + <pattern>google.api</pattern> + <shadedPattern>${shadeBase}.google.api</shadedPattern> + </relocation> + <relocation> + <pattern>google.apps</pattern> + <shadedPattern>${shadeBase}.google.apps</shadedPattern> + </relocation> + <relocation> + <pattern>google.cloud</pattern> + <shadedPattern>${shadeBase}.google.cloud</shadedPattern> + </relocation> + <relocation> + <pattern>google.geo</pattern> + <shadedPattern>${shadeBase}.google.geo</shadedPattern> + </relocation> + <relocation> + <pattern>google.iam</pattern> + <shadedPattern>${shadeBase}.google.iam</shadedPattern> + </relocation> + <relocation> + <pattern>google.logging</pattern> + <shadedPattern>${shadeBase}.google.logging</shadedPattern> + </relocation> + <relocation> + <pattern>google.longrunning</pattern> + <shadedPattern>${shadeBase}.google.longrunning</shadedPattern> + </relocation> + <relocation> + <pattern>google.monitoring</pattern> + <shadedPattern>${shadeBase}.google.monitoring</shadedPattern> + </relocation> + <relocation> + <pattern>google.protobuf</pattern> + <shadedPattern>${shadeBase}.google.protobuf</shadedPattern> + </relocation> + <relocation> + <pattern>google.rpc</pattern> + <shadedPattern>${shadeBase}.google.rpc</shadedPattern> + </relocation> + <relocation> + <pattern>google.shopping</pattern> + <shadedPattern>${shadeBase}.google.shopping</shadedPattern> + </relocation> + <relocation> + <pattern>google.storage</pattern> + <shadedPattern>${shadeBase}.google.storage</shadedPattern> + </relocation> + <relocation> + <pattern>google.type</pattern> + <shadedPattern>${shadeBase}.google.type</shadedPattern> + </relocation> + <relocation> + <pattern>org.joda</pattern> + <shadedPattern>${shadeBase}.joda</shadedPattern> + </relocation> + <relocation> + <pattern>com.yammer</pattern> + <shadedPattern>${shadeBase}.yammer</shadedPattern> + </relocation> + <relocation> + <pattern>javax.servlet</pattern> + <shadedPattern>${shadeBase}.javax.servlet</shadedPattern> + </relocation> + <relocation> + <pattern>org.jsoup</pattern> + <shadedPattern>${shadeBase}.org.jsoup</shadedPattern> + </relocation> + <relocation> + <pattern>org.bouncycastle</pattern> + <shadedPattern>${shadeBase}.org.bouncycastle</shadedPattern> + </relocation> + <relocation> + <pattern>com.nimbusds</pattern> + <shadedPattern>${shadeBase}.com.nimbusds</shadedPattern> + </relocation> + <relocation> + <pattern>javax.annotation</pattern> + <shadedPattern>${shadeBase}.javax.annotation</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>io.netty</pattern> + <shadedPattern>${shadeBase}.io.netty</shadedPattern> + </relocation> + <relocation> + <pattern>com.carrotsearch</pattern> + <shadedPattern>${shadeBase}.com.carrotsearch</shadedPattern> + </relocation> + <relocation> + <pattern>io.opencensus</pattern> + <shadedPattern>${shadeBase}.opencensus</shadedPattern> + </relocation> + <relocation> + <pattern>io.opentelemetry</pattern> + <shadedPattern>${shadeBase}.opentelemetry</shadedPattern> + </relocation> + <relocation> + <pattern>org.threeten</pattern> + <shadedPattern>${shadeBase}.threeten</shadedPattern> + </relocation> + <relocation> + <pattern>io.grpc</pattern> + <shadedPattern>${shadeBase}.grpc</shadedPattern> + </relocation> + <relocation> + <pattern>META-INF.native.io_grpc_netty_shaded_netty_tcnative</pattern> + <shadedPattern>META-INF.native.${shadeNativeBase}_grpc_netty_shaded_netty_tcnative</shadedPattern> + </relocation> + <relocation> + <pattern>META-INF.native.libio_grpc_netty_shaded_netty_tcnative</pattern> + <shadedPattern>META-INF.native.lib${shadeNativeBase}_grpc_netty_shaded_netty_tcnative</shadedPattern> + </relocation> + <relocation> + <pattern>META-INF.native.io_grpc_netty_shaded_netty_transport_native_epoll</pattern> + <shadedPattern>META-INF.native.${shadeNativeBase}_grpc_netty_shaded_netty_transport_native_epoll</shadedPattern> + </relocation> + <relocation> + <pattern>META-INF.native.libio_grpc_netty_shaded_netty_transport_native_epoll</pattern> + <shadedPattern>META-INF.native.lib${shadeNativeBase}_grpc_netty_shaded_netty_transport_native_epoll</shadedPattern> + </relocation> + <relocation> + <pattern>org.checkerframework</pattern> + <shadedPattern>${shadeBase}.org.checkerframework</shadedPattern> + </relocation> + <relocation> + <pattern>org.codehaus</pattern> + <shadedPattern>${shadeBase}.org.codehaus</shadedPattern> + </relocation> + <relocation> + <pattern>io.perfmark</pattern> + <shadedPattern>${shadeBase}.io.perfmark</shadedPattern> + </relocation> + <relocation> + <pattern>org.conscrypt</pattern> + <shadedPattern>${shadeBase}.org.conscrypt</shadedPattern> + </relocation> + <relocation> + <pattern>conscrypt_openjdk_jni</pattern> + <shadedPattern>${shadeNativeBase}_conscrypt_openjdk_jni</shadedPattern> + </relocation> + <relocation> + <pattern>META-INF.native.conscrypt_openjdk_jni</pattern> + <shadedPattern>META-INF.native.${shadeNativeBase}_conscrypt_openjdk_jni</shadedPattern> + </relocation> + <relocation> + <pattern>META-INF.native.libconscrypt_openjdk_jni</pattern> + <shadedPattern>META-INF.native.lib${shadeNativeBase}_conscrypt_openjdk_jni</shadedPattern> + </relocation> + <relocation> + <pattern>opencensus</pattern> + <shadedPattern>${shadeBase}.opencensus</shadedPattern> + </relocation> + <relocation> + <pattern>grpc</pattern> + <shadedPattern>${shadeBase}.grpc</shadedPattern> + </relocation> + <relocation> + <pattern>android.annotation</pattern> + <shadedPattern>${shadeBase}.android.annotation</shadedPattern> + </relocation> + </relocations> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <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/versions/9/module-info.*</exclude> + <exclude>META-INF/*.xml</exclude> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + <exclude>.netbeans_automatic_build</exclude> + <exclude>git.properties</exclude> + <exclude>arrow-git.properties</exclude> + <exclude>google-http-client.properties</exclude> + <exclude>storage.v1.json</exclude> + <!-- This is just a documentation file, not needed--> + <exclude>pipes-fork-server-default-log4j2.xml</exclude> + <exclude>dependencies.properties</exclude> + <exclude>pipes-fork-server-default-log4j2.xml</exclude> + </excludes> + </filter> + <filter> + <artifact>org.apache.arrow:arrow-vector</artifact> + <excludes> + <!-- codegen directory is used to generate java code for arrow vector package. Excludes them since we only need class file --> + <exclude>codegen/**</exclude> + </excludes> + </filter> + <filter> + <artifact>com.google.guava:guava</artifact> + <includes> + <include>com/google/common/io/**</include> + <include>com/google/common/base/**</include> + <include>com/google/common/hash/**</include> + <include>com/google/common/collect/**</include> + <include>com/google/common/graph/**</include> + <include>com/google/common/math/**</include> + <include>com/google/common/util/concurrent/**</include> + </includes> + </filter> + <filter> + <artifact>commons-logging:commons-logging</artifact> + <excludes> + <exclude>org/apache/commons/logging/impl/AvalonLogger.class</exclude> + </excludes> + </filter> + </filters> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/> + <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> + <resource>META-INF/io.netty.versions.properties</resource> + </transformer> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <!-- relocate the META-INF/versions files manually due to the maven bug --> + <!-- https://issues.apache.org/jira/browse/MSHADE-406 --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>repack</id> + <goals> + <goal>run</goal> + </goals> + <phase>package</phase> + <configuration> + <target> + <unzip dest="${project.build.directory}/relocate" src="${project.build.directory}/${project.build.finalName}.jar"/> + <mkdir dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> + <mkdir dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> + <mkdir dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/> + <mkdir dir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/> + <mkdir dir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> + <mkdir dir="${project.build.directory}/relocate/META-INF/versions/22/${relocationBase}"/> + <!-- org.bouncycastle.* packages are relocated to ${relocationBase}.org.bouncycastle.* --> + <move file="${project.build.directory}/relocate/META-INF/versions/9/org" todir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> + <move file="${project.build.directory}/relocate/META-INF/versions/11/org" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> + <move file="${project.build.directory}/relocate/META-INF/versions/15/org" todir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/> + <move file="${project.build.directory}/relocate/META-INF/versions/21/org" todir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> + <!-- com.fasterxml.* packages are relocated to ${relocationBase}.fasterxml.* --> + <move file="${project.build.directory}/relocate/META-INF/versions/11/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> + <move file="${project.build.directory}/relocate/META-INF/versions/17/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/> + <move file="${project.build.directory}/relocate/META-INF/versions/21/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> + <move file="${project.build.directory}/relocate/META-INF/versions/22/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/22/${relocationBase}"/> + <!-- io.opentelemetry.* packages are relocated to ${relocationBase}.io.opentelemetry.* --> + <move file="${project.build.directory}/relocate/META-INF/versions/9/io" todir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> + <zip basedir="${project.build.directory}/relocate" destfile="${project.build.directory}/${project.build.finalName}.jar"/> + <delete dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/> + <delete dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/> + <delete dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/> + <delete dir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/> + <delete dir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/> + <delete dir="${project.build.directory}/relocate/META-INF/versions/22/${relocationBase}"/> + </target> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <configuration> + <timestampFormat>yyyyMMddHHmmss</timestampFormat> + <timestampPropertyName>buildNumber.timestamp</timestampPropertyName> + <doCheck>false</doCheck> + <revisionOnScmFailure/> + <doUpdate>false</doUpdate> + <!--- Note for those who come later. If you specify "buildNumber" in the items field, it becomes an incrementing buildNumber + AFAIK (and I spent a lot of time on this) it is impossible to get the SCM rev number and incrementing build number at the same time --> + </configuration> + <executions> + <execution> + <goals> + <goal>create-timestamp</goal> + </goals> + <phase>package</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>java-9</id> + <activation> + <jdk>(9,)</jdk> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <argLine>--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skipTests>${skip.unitTests}</skipTests> + <argLine>--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine> + </configuration> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>jenkinsIT</id> + <activation> + <property> + <name>jenkinsIT</name> + </property> + </activation> + <build> + <plugins> + <!-- + Downloading + 1. japicmp + 2. maven-dependency-plugin analyst + in jenkins node would cause http connection failure. Temporarily disable them. + --> + <plugin> + <groupId>com.github.siom79.japicmp</groupId> + <artifactId>japicmp-maven-plugin</artifactId> + <executions> + <execution> + <id>japicmp</id> + <goals> + <goal>cmp</goal> + </goals> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>analyze</id> + <goals> + <goal>analyze-only</goal> + </goals> + <phase>none</phase> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <test>UnitTestSuite</test> + <skipTests>${skip.unitTests}</skipTests> + </configuration> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${version.plugin.surefire}</version> + </dependency> + </dependencies> + <executions> + <execution> + <goals> + <goal>test</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>verify</goal> + </goals> + </execution> + <execution> + <id>DefaultIT</id> + <goals> + <goal>integration-test</goal> + </goals> + <configuration> + <systemPropertyVariables> + <net.snowflake.jdbc.loggerImpl>net.snowflake.client.log.JDK14Logger</net.snowflake.jdbc.loggerImpl> + <java.util.logging.config.file>${basedir}/src/test/resources/logging.properties</java.util.logging.config.file> + </systemPropertyVariables> + <test>${integrationTestSuites}</test> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <configuration> + <skip>${jacoco.skip.instrument}</skip> + </configuration> + <executions> + <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> + + <profile> + <id>check-content</id> + <activation> + <os> + <family>!windows</family> + </os> + <property> + <name>!thin-jar</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>${version.plugin.exec}</version> + <executions> + <execution> + <id>check-shaded-content</id> + <goals> + <goal>exec</goal> + </goals> + <phase>verify</phase> + <configuration> + <executable>${basedir}/ci/scripts/check_content.sh</executable> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + + <profile> + <id>check-content-thin</id> + <activation> + <os> + <family>!windows</family> + </os> + <property> + <name>thin-jar</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>${version.plugin.exec}</version> + <executions> + <execution> + <id>check-shaded-content</id> + <goals> + <goal>exec</goal> + </goals> + <phase>verify</phase> + <configuration> + <executable>${basedir}/ci/scripts/check_content.sh</executable> + <arguments> + <argument>-thin</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>qa1IT</id> + <activation> + <property> + <name>qa1IT</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <includes> + <include>**/*IT.java</include> + </includes> + </configuration> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${version.plugin.surefire}</version> + </dependency> + </dependencies> + <executions> + <execution> + <goals> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>DellBoomi</id> + <activation> + <property> + <name>dellBoomiIT</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <includes> + <include>**/*IT.java</include> + </includes> + </configuration> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${version.plugin.surefire}</version> + </dependency> + </dependencies> + <executions> + <execution> + <goals> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>preprod3IT</id> + <activation> + <property> + <name>preprod3IT</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <includes> + <include>**/*IT.java</include> + </includes> + </configuration> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${version.plugin.surefire}</version> + </dependency> + </dependencies> + <executions> + <execution> + <goals> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>ossrh-deploy</id> + <activation> + <property> + <name>ossrhDeploy</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <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> + </profiles> +</project> diff --git a/src/main/java/net/snowflake/client/core/SFSession.java b/src/main/java/net/snowflake/client/core/SFSession.java index ecef55de3..997a33ea5 100644 --- a/src/main/java/net/snowflake/client/core/SFSession.java +++ b/src/main/java/net/snowflake/client/core/SFSession.java @@ -18,6 +18,7 @@ import java.sql.SQLException; import java.time.Duration; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -675,6 +676,7 @@ public synchronized void open() throws SFException, SnowflakeSQLException { .setToken((String) connectionPropertiesMap.get(SFSessionProperty.TOKEN)) .setPasscodeInPassword(passcodeInPassword) .setPasscode((String) connectionPropertiesMap.get(SFSessionProperty.PASSCODE)) + .setAdditionalHttpHeadersForSnowsight(getHttpHeaders()) .setConnectionTimeout( connectionPropertiesMap.get(SFSessionProperty.HTTP_CLIENT_CONNECTION_TIMEOUT) != null ? Duration.ofMillis( @@ -812,6 +814,29 @@ public synchronized void open() throws SFException, SnowflakeSQLException { logger.debug("Session {} opened in {} ms.", getSessionId(), stopwatch.elapsedMillis()); } + public Map<String, String> getHttpHeaders() { + if (getConnectionPropertiesMap() != null + && getConnectionPropertiesMap().get(SFSessionProperty.ADDITIONAL_HTTP_HEADERS) != null) { + return getHttpHeaders( + (String) getConnectionPropertiesMap().get(SFSessionProperty.ADDITIONAL_HTTP_HEADERS)); + } + return Collections.emptyMap(); + } + + public Map<String, String> getHttpHeaders(String headers) { + if (headers != null && !headers.isEmpty()) { + Map<String, String> headersMap = new HashMap<>(); + for (String headerKeyPair : headers.split(";")) { + String[] split = headerKeyPair.split(":"); + if (split.length >= 2) { + headersMap.put(split[0], split[1]); + } + } + return headersMap; + } + return null; + } + /** * If authenticator is null and private key is specified, jdbc will assume key pair authentication * @@ -939,6 +964,7 @@ public void close() throws SFException, SnowflakeSQLException { .setSessionToken(sessionToken) .setLoginTimeout(loginTimeout) .setRetryTimeout(retryTimeout) + .setAdditionalHttpHeadersForSnowsight(getHttpHeaders()) .setOCSPMode(getOCSPMode()) .setHttpClientSettingsKey(getHttpClientKey()); @@ -1084,6 +1110,11 @@ protected void heartbeat() throws SFException, SQLException { logger.debug("Executing heartbeat request: {}", postRequest.toString()); + Map<String, String> httpHeaders = getHttpHeaders(); + if (httpHeaders != null) { + httpHeaders.forEach(postRequest::addHeader); + } + // the following will retry transient network issues // increase heartbeat timeout from 60 sec to 300 sec // per https://support-snowflake.zendesk.com/agent/tickets/6629 diff --git a/src/main/java/net/snowflake/client/core/SFSessionProperty.java b/src/main/java/net/snowflake/client/core/SFSessionProperty.java index a5e7276c5..29c3e2db2 100644 --- a/src/main/java/net/snowflake/client/core/SFSessionProperty.java +++ b/src/main/java/net/snowflake/client/core/SFSessionProperty.java @@ -63,6 +63,7 @@ public enum SFSessionProperty { @Deprecated PRIVATE_KEY_FILE_PWD("private_key_file_pwd", false, String.class), PRIVATE_KEY_PWD("private_key_pwd", false, String.class), + ADDITIONAL_HTTP_HEADERS("additional_http_headers", false, String.class), CLIENT_INFO("snowflakeClientInfo", false, String.class), ALLOW_UNDERSCORES_IN_HOST("allowUnderscoresInHost", false, Boolean.class), diff --git a/src/main/java/net/snowflake/client/core/SFStatement.java b/src/main/java/net/snowflake/client/core/SFStatement.java index 0d0668e27..20a7b13c9 100644 --- a/src/main/java/net/snowflake/client/core/SFStatement.java +++ b/src/main/java/net/snowflake/client/core/SFStatement.java @@ -424,6 +424,7 @@ public Object executeHelper( .setOCSPMode(session.getOCSPMode()) .setHttpClientSettingsKey(session.getHttpClientKey()) .setMaxRetries(session.getMaxHttpRetries()) + .setAdditionalHttpHeadersForSnowsight(session.getHttpHeaders()) .setQueryContextDTO(session.isAsyncSession() ? null : session.getQueryContextDTO()); if (bindStagePath != null) { stmtInput.setBindValues(null).setBindStage(bindStagePath); diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java index 2baf8027a..fae33c249 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java @@ -865,6 +865,18 @@ private void parseChunkFiles(JsonNode rootNode, SFBaseStatement sfStatement) { } } + if (sfStatement.getSFBaseSession() instanceof SFSession) { + Map<String, String> httpHeaders = + ((SFSession) sfStatement.getSFBaseSession()).getHttpHeaders(); + if (httpHeaders != null) { + for (Map.Entry<String, String> httpHeader : httpHeaders.entrySet()) { + logger.debug( + "Add header key: {}, value: {}", httpHeader.getKey(), httpHeader.getValue()); + this.chunkHeadersMap.put(httpHeader.getKey(), httpHeader.getValue()); + } + } + } + // parse chunk files metadata e.g. url and row count for (int idx = 0; idx < this.chunkFileCount; idx++) { JsonNode chunkNode = chunksNode.get(idx); diff --git a/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java b/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java index 50efb9234..30acc255b 100644 --- a/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java +++ b/src/main/java/net/snowflake/client/jdbc/telemetry/TelemetryClient.java @@ -11,6 +11,7 @@ import java.sql.Connection; import java.sql.SQLException; import java.util.LinkedList; +import java.util.Map; import java.util.Objects; import java.util.concurrent.Future; import net.snowflake.client.core.HttpUtil; @@ -360,6 +361,13 @@ private boolean sendBatch() throws IOException { "Snowflake Token=\"" + this.session.getSessionToken() + "\""); } + if (this.session != null) { + Map<String, String> httpHeaders = this.session.getHttpHeaders(); + if (httpHeaders != null) { + httpHeaders.forEach(post::addHeader); + } + } + String response = null; try {