Setting Up Other Development Environments for Snowpark Java¶
If you are using a development environment not covered earlier (see Setting Up Your Development Environment for Snowpark Java), see the instructions in this topic for configuring your environment to use Snowpark.
Using the Snowpark Library in a Maven Project¶
To integrate the Snowpark library into a Maven project, add the library as a dependency to your
pom.xml file. For example:
<dependencies> ... <dependency> <groupId>com.snowflake</groupId> <artifactId>snowpark</artifactId> <version>1.7.1</version> </dependency> ... </dependencies>
<version> tag to the version of the library that you want to use. Note that version 1.7.1 is
used in this example for illustration purposes only. The latest available version of the driver may be higher.
Downloading the Snowpark Library and its Dependencies¶
If you are not using Maven to manage the dependencies for your application and you need a copy of the Snowpark library and its dependencies, you can download a TAR archive file or a zip file that contains the JAR files for the library and all of its dependencies. The TAR/ZIP archive includes the API reference documentation in javadoc format.
To download the Snowpark library:
Go to the Snowpark Client Download page, and find the version that you want to use.
The rest of the steps use 1.7.1 as an example.
Browse to the directory for the version that you want to use. The rest of the steps use 1.7.1 as an example.
Download the snowpark-1.7.1-bundle.tar.gz (or .zip) file.
As of Snowpark 0.9.0, rather than downloading an archive file that contains the Snowpark library and its dependencies in separate JAR files, you can choose to download a single JAR file that contains the Snowpark library and its dependencies. This JAR file is named snowpark-1.7.1-with-dependencies.jar.
If you download this JAR file, skip the rest of the steps. (The steps apply to the archive file.)
If you you want to verify the signature of the file:
Download the snowpark-1.7.1-bundle.tar.gz.asc file.
From the public keyserver, download and import the Snowflake GPG public key for the version of the library that you are using:
For version 1.6.1 and higher:
$ gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 630D9F3CAB551AF3
For version 0.6.0 through 1.6.0:
$ gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 37C7086698CB005C
If this command fails with the following error:
gpg: keyserver receive failed: Server indicated a failure
then specify that you want to use port 80 for the keyserver:
gpg --keyserver hkp://keyserver.ubuntu.com:80 ...
Run the following command to verify the signature. For example:
gpg --verify snowpark-1.7.1-bundle.tar.gz.asc snowpark-1.7.1-bundle.tar.gz
The output of the command should indicate that the archive file was signed with this key.
Verifying the signature produces a warning similar to the following:
gpg: Signature made Mon 24 Sep 2018 03:03:45 AM UTC using RSA key ID <gpg_key_id> gpg: Good signature from "Snowflake Computing <email@example.com>" unknown gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner.
To avoid the warning, you can grant the Snowflake GPG public key implicit trust.
Extract the contents of the archive file.
README.txtfile in the archive file describes the contents of each directory.
Add the following extracted file and directory to the classpath for building and running your application:
the snowpark-1.7.1.jar file
the lib directory