Description
Kind of a complicated edge case, but very central to the way our build is laid out:
If you have a direct dependency on a shared component, that is also a transitive dependency, and you use force="true" to force a particular version of the shared component to be resolved, in some cases you can end up with multiple versions getting downloaded.
As far as we can tell this only occurs in the following scenario:
- There is more than one transitive dependency on the shared library
- The components that depend on the shared dependency reference it with a range
- The ranges are not identical in the two components that reference the shared library
For example: two versions of shared exist, 2.1.1 and integration-0.0.0
In ivy.xml
<dependency name="shared" rev="integration-0.0.0" conf="src,build->default" force="true" />
<dependency name="direct_dependency" rev="1.0" conf="src,build->default" />
In in direct_dependency ivy.xml:
<dependency name="component_a" rev="[2,3[" />
<dependency name="component_b" rev="[2,3["/>
In component_a ivy.xml:
<dependency name="shared" rev="[2,3.0[" />
In component_b ivy.xml
<dependency name="shared" rev="[2.1,3.0[" />
If the references to 'shared' in component_a and component_b are both ranges and not exactly the same, we end up with both shared-integration-0.0.0 and shared-2.1.2 getting downloaded.
If either reference is not a range, or if both ranges are identical, then shared-2.1.2 is evicted and only integration-0.0.0 is downloaded.