Skip to content

Download MSAL4J And AKV Dependencies with Apache Maven

lilgreenbird edited this page May 31, 2023 · 11 revisions

The Microsoft JDBC Driver for SQL Server has 2 compile time dependencies:

  • azure-security-keyvault-keys : Microsoft Azure Client Library For KeyVault Keys for Always Encrypted Azure Key Vault feature (optional).
  • azure-identity : Microsoft Azure Client Library For Identity Library for Azure Active Directory Authentication feature and Azure Key Vault feature (optional).

Those 2 dependencies are not required at run time if users do not use Azure Key Vault or Azure Active Directory Authentication. However, if users want to use those features, they need to download the correct versions of the dependencies and include them into their CLASSPATH.

Steps to download dependencies with Apache Maven:

  1. Download and install Apache Maven.

  2. Download the Microsoft JDBC Driver for SQL Server from GitHub.

  3. Goto the project root

  cd /path/to/where/you/cloned/the/driver/project/mssql-jdbc
  1. The pom.xml file contains all dependencies of the driver in the <dependencies>...</dependencies> block. Use maven to download all the dependencies to target/dependency folder.

    Please make sure to use the pom.xml associated with the version of the driver as you need the correct version of the dependent libraries for the release you are using to ensure the feature works properly.

  <maven_installation_path>/bin/mvn dependency:copy-dependencies
  1. The pom.xml file will default to a profile targeting the latest version of JRE that we support. If you need to use older versions you can move the <activation>...</activation> block to the appropriate profile.

Once the dependent libraries are downloaded, add them to the CLASSPATH of your user application.