-
Notifications
You must be signed in to change notification settings - Fork 430
Download MSAL4J And AKV Dependencies with Apache Maven
lilgreenbird edited this page Apr 6, 2022
·
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 dependencies and include them into their classpath.
- Download and install Apache Maven
- Download the Microsoft JDBC Driver for SQL Server from GitHub, there is a file called pom.xml in the root directory. It contains all the dependency definitions. Please make sure to use the pom.xml associated with the version of the driver you are using as there may be different versions of the libaries.
- In pom.xml file, all dependencies are listed in
<dependencies>...</dependencies>
block. Comment out all test dependencies and keepazure-security-keyvault-keys
andazure-identity
intact. In this case, it will download bothazure-security-keyvault-keys
andazure-identity
and their dependencies as well. - Open Termial/CMD and
cd
to the directory that contains pom.xml, run command<maven_installation_path>/bin/mvn dependency:copy-dependencies
. It will download all the dependencies intotarget/dependency
folder. Now, you have all the dependencies you need to use Azure Key Vault and Azure Active Directory Authentication feature. - 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.