in a moduleA with libB, there’s 3 place may define the version of libB:
- direct dependencies:
- transitive dependencies
- constraints dependencies
“”"
When Gradle attempts to resolve a dependency to a module version, all dependency declarations with version, all transitive dependencies and all dependency constraints for that module are taken into consideration. The highest version that matches all conditions is selected.
“”"
If moduleA has only transitive dependencies of libB(no direct dependencies). and we want to upgrade the version of libB.
Question:
-
whether i use the
direct dependenciesorconstraints dependenciesto upgrade the version, the result is same(because gradle just choose the highest), is this true? -
the only difference is just on the senmantic level, that
constraints dependenciesmean moduleA is not direct rely on libB,
but same on tech level, because moduleA has transitive dependencies of libB, libB is already on classpath of moduleA, no matter whether i use thedirect dependenciesorconstraints dependencies.
is this true?