Whenever, as a developer, you decide to include a dependency, you must understand that there are
consequences for your consumers
.
For example, if you add a dependency to your project, it becomes a
transitive dependency
of your consumers, and therefore may participate in conflict resolution if the consumer needs a different version.
A lot of the problems Gradle handles are about fixing the mismatch between the expectations of a consumer and a producer.
However, some projects are easier than others:
-
if you are at the end of the consumption chain, that is to say you build an
application
, then there are effectively
no consumer
of your project (apart from final customers): adding
exclusions
will have no other consequence than fixing your problem.
-
however if you are a library, adding
exclusions
may prevent consumers from working properly, because they would exercise a path of the code that you don’t
Always keep in mind that the solution you choose to fix a problem can "leak" to your consumers.
This documentation aims at guiding you to find the right solution to the right problem, and more importantly, make decisions which help the resolution engine to take the right decisions in case of conflicts.