Search⌘ K
AI Features

Optional Dependencies

This lesson explains how dependencies can be marked optional so that they are subsequently excluded as transitive dependencies.

We'll cover the following...

Consider you are working on a project that requires custom parsing of JSON. Your colleague already has a jar artifact that can do what you are looking for, and under the hood it uses either Google’s Gson or Fasterxml’s Jackson libraries to parse JSON objects. Furthermore, a user can configure your colleague’s code to use one of two libraries when parsing JSON but not both. Say you decide to configure your colleague’s jar to use ...