Skip to content

Commit

Permalink
Merge pull request #148 from v-xiangs/optional-dependencies
Browse files Browse the repository at this point in the history
make Azure Key Vault and Azure Active Directory Authentication Dependencies optional
  • Loading branch information
ajlam authored Feb 16, 2017
2 parents 46ee96d + 406efb8 commit ca59185
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ The driver can be downloaded from the [Microsoft Download Center](https://www.mi
This project has following dependencies:

Compile Time:
- `azure-keyvault` : Azure Key Vault Provider for Always Encrypted feature
- `azure-keyvault` : Azure Key Vault Provider for Always Encrypted feature (optional)
- `adal4j` : Azure ActiveDirectory Library for Java for Azure Active Directory Authentication feature (optional)

Test Time:
- `junit:jar` : For Unit Test cases.
Expand All @@ -98,21 +99,22 @@ One can see all dependencies including Transitive Dependency by executing follow
mvn dependency:tree
```

###Exclude Dependencies
If you wish to limit the number of run-time dependencies, and your project does not require the features named above, you can explicitly exclude them by adding exclusion tag.
***For Example:*** If you are not using *Always Encrypted Azure Key Vault feature* then you can exclude *azure-keyvault* dependency. Please see following snippet.
### Azure Key Vault and Azure Active Directory Authentication Dependencies
Projects that require either of the two features need to explicitly declare the dependency in their pom file.

***For Example:*** If you are using *Azure Key Vault feature* then you need to redeclare *azure-keyvault* dependency in your project's pom file. Please see the following snippet:
```
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
<version>0.9.7</version>
</dependency>
```

Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
<version>0.9.7</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.1.3</version>
<optional>true</optional>
</dependency>

<!-- dependency for running tests -->
Expand Down

0 comments on commit ca59185

Please sign in to comment.