Class ConfigurableVersionSelector.VersionConvergence
java.lang.Object
org.eclipse.aether.util.graph.transformer.ConfigurableVersionSelector.VersionConvergence
- All Implemented Interfaces:
ConfigurableVersionSelector.SelectionStrategy
- Enclosing class:
ConfigurableVersionSelector
public static class ConfigurableVersionSelector.VersionConvergence
extends Object
implements ConfigurableVersionSelector.SelectionStrategy
Example selection strategy (used in tests and demos), is not recommended to be used in production.
Selection strategy that delegates to another selection strategy, and at the end enforces dependency convergence among candidates.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isBetter
(ConflictResolver.ConflictItem candidate, ConflictResolver.ConflictItem winner) Invoked for every "candidate" when winner is already set (very first candidate is set as winner).winnerSelected
(ConflictResolver.ConflictItem winner, Collection<ConflictResolver.ConflictItem> candidates, ConflictResolver.ConflictContext context) Method invoked at version selection end, just before version selector returns.
-
Constructor Details
-
VersionConvergence
-
-
Method Details
-
isBetter
public boolean isBetter(ConflictResolver.ConflictItem candidate, ConflictResolver.ConflictItem winner) Description copied from interface:ConfigurableVersionSelector.SelectionStrategy
Invoked for every "candidate" when winner is already set (very first candidate is set as winner).This method should determine is candidate "better" or not and should replace current winner. This method is invoked whenever
candidate
is "considered" (fits any constraint in effect, if any).- Specified by:
isBetter
in interfaceConfigurableVersionSelector.SelectionStrategy
-
winnerSelected
public ConflictResolver.ConflictItem winnerSelected(ConflictResolver.ConflictItem winner, Collection<ConflictResolver.ConflictItem> candidates, ConflictResolver.ConflictContext context) throws org.eclipse.aether.collection.UnsolvableVersionConflictException Description copied from interface:ConfigurableVersionSelector.SelectionStrategy
Method invoked at version selection end, just before version selector returns. Note:winner
may benull
, while the rest of parameters cannot. The parametercandidates
contains all the "considered candidates", dependencies that fulfil all constraints, if present. Thecontext
on the other hand contains all items participating in conflict.This method by default just returns the passed in
winner
, but can do much more.- Specified by:
winnerSelected
in interfaceConfigurableVersionSelector.SelectionStrategy
- Throws:
org.eclipse.aether.collection.UnsolvableVersionConflictException
-