Class ConfigurableVersionSelector
java.lang.Object
org.eclipse.aether.util.graph.transformer.ConflictResolver.VersionSelector
org.eclipse.aether.util.graph.transformer.ConfigurableVersionSelector
A configurable version selector for use with
ConflictResolver that resolves version conflicts using a
specified strategy. If there is no single node that satisfies all encountered version ranges, the selector will fail.
Based on configuration, this selector may fail for other reasons as well.- Since:
- 2.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic classSelection strategy that selects "highest" version.static classExample selection strategy (used in tests and demos), is not recommended to be used in production.static classSelection strategy that selects "nearest" (to the root) version.static interfaceThe strategy how "winner" is being selected.static classExample selection strategy (used in tests and demos), is not recommended to be used in production. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConfigurableVersionSelector.SelectionStrategyThe strategy of winner selection, nevernull. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this version selector that works "as Maven did so far".ConfigurableVersionSelector(ConfigurableVersionSelector.SelectionStrategy selectionStrategy) Creates a new instance of this version selector. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbacktrack(ConfigurableVersionSelector.ConflictGroup group, ConflictResolver.ConflictContext context) protected booleanisAcceptableByConstraints(ConfigurableVersionSelector.ConflictGroup group, org.eclipse.aether.version.Version version) static org.eclipse.aether.collection.UnsolvableVersionConflictExceptionnewFailure(String message, ConflictResolver.ConflictContext context) Helper method to create failure, creates instance ofUnsolvableVersionConflictException.voidDetermines the winning node among conflicting dependencies.Methods inherited from class org.eclipse.aether.util.graph.transformer.ConflictResolver.VersionSelector
getInstance
-
Field Details
-
selectionStrategy
The strategy of winner selection, nevernull.
-
-
Constructor Details
-
ConfigurableVersionSelector
public ConfigurableVersionSelector()Creates a new instance of this version selector that works "as Maven did so far". -
ConfigurableVersionSelector
Creates a new instance of this version selector.- Parameters:
selectionStrategy- The winner selection strategy, must not benull. Maven3 usedConfigurableVersionSelector.Neareststrategy.
-
-
Method Details
-
selectVersion
public void selectVersion(ConflictResolver.ConflictContext context) throws org.eclipse.aether.RepositoryException Description copied from class:ConflictResolver.VersionSelectorDetermines the winning node among conflicting dependencies. Implementations will usually iterateConflictResolver.ConflictContext.getItems(), inspectConflictResolver.ConflictItem.getNode()and eventually callConflictResolver.ConflictContext.setWinner(ConflictResolver.ConflictItem)to deliver the winner. Failure to select a winner will automatically fail the entire conflict resolution.- Specified by:
selectVersionin classConflictResolver.VersionSelector- Parameters:
context- The conflict context, must not benull.- Throws:
org.eclipse.aether.RepositoryException- If the version selection failed.
-
backtrack
protected void backtrack(ConfigurableVersionSelector.ConflictGroup group, ConflictResolver.ConflictContext context) throws org.eclipse.aether.collection.UnsolvableVersionConflictException - Throws:
org.eclipse.aether.collection.UnsolvableVersionConflictException
-
isAcceptableByConstraints
protected boolean isAcceptableByConstraints(ConfigurableVersionSelector.ConflictGroup group, org.eclipse.aether.version.Version version) -
newFailure
public static org.eclipse.aether.collection.UnsolvableVersionConflictException newFailure(String message, ConflictResolver.ConflictContext context) Helper method to create failure, creates instance ofUnsolvableVersionConflictException.
-