Class ConflictResolver
- All Implemented Interfaces:
org.eclipse.aether.collection.DependencyGraphTransformer
ConflictResolver.VersionSelector, ConflictResolver.ScopeSelector, ConflictResolver.OptionalitySelector and
ConflictResolver.ScopeDeriver.
By default, this graph transformer will turn the dependency graph into a tree without duplicate artifacts. Using the
configuration property CONFIG_PROP_VERBOSE, a verbose mode can be enabled where the graph is still turned
into a tree but all nodes participating in a conflict are retained. The nodes that were rejected during conflict
resolution have no children and link back to the winner node via the NODE_DATA_WINNER key in their custom
data. Additionally, the keys NODE_DATA_ORIGINAL_SCOPE and NODE_DATA_ORIGINAL_OPTIONALITY are used
to store the original scope and optionality of each node. Obviously, the resulting dependency tree is not suitable
for artifact resolution unless a filter is employed to exclude the duplicate dependencies.
This transformer will query the keys TransformationContextKeys.CONFLICT_IDS,
TransformationContextKeys.SORTED_CONFLICT_IDS, TransformationContextKeys.CYCLIC_CONFLICT_IDS for
existing information about conflict ids. In absence of this information, it will automatically invoke the
ConflictIdSorter to calculate it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA context used to hold information that is relevant for resolving version and scope conflicts.static final classA conflicting dependency.static classAn extension point ofConflictResolverthat determines the effective optional flag of a dependency from a potentially conflicting set of derived optionalities.static final classA context used to hold information that is relevant for deriving the scope of a child dependency.static classAn extension point ofConflictResolverthat determines the scope of a dependency in relation to the scope of its parent.static classAn extension point ofConflictResolverthat determines the effective scope of a dependency from a potentially conflicting set ofderived scopes.static enumThe enum representing verbosity levels of conflict resolver.static classAn extension point ofConflictResolverthat determines the winner among conflicting dependencies. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key in the repository session'sconfiguration propertiesused to store aBooleanflag controlling the transformer's verbose mode.static final StringThe key in the dependency node'scustom dataunder which the optional flag of the dependency before derivation and conflict resolution is stored.static final StringThe key in the dependency node'scustom dataunder which the scope of the dependency before scope derivation and conflict resolution is stored.static final StringThe key in the dependency node'scustom dataunder which a reference to theDependencyNodewhich has won the conflict is stored. -
Constructor Summary
ConstructorsConstructorDescriptionConflictResolver(ConflictResolver.VersionSelector versionSelector, ConflictResolver.ScopeSelector scopeSelector, ConflictResolver.OptionalitySelector optionalitySelector, ConflictResolver.ScopeDeriver scopeDeriver) Creates a new conflict resolver instance with the specified hooks. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.aether.graph.DependencyNodetransformGraph(org.eclipse.aether.graph.DependencyNode node, org.eclipse.aether.collection.DependencyGraphTransformationContext context)
-
Field Details
-
CONFIG_PROP_VERBOSE
The key in the repository session'sconfiguration propertiesused to store aBooleanflag controlling the transformer's verbose mode. Accepted values are Boolean types, String type (where "true" would be interpreted astrue) or Verbosity enum instances.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Object- Default value:
- "NONE"
-
NODE_DATA_WINNER
The key in the dependency node'scustom dataunder which a reference to theDependencyNodewhich has won the conflict is stored.- See Also:
-
NODE_DATA_ORIGINAL_SCOPE
The key in the dependency node'scustom dataunder which the scope of the dependency before scope derivation and conflict resolution is stored.- See Also:
-
NODE_DATA_ORIGINAL_OPTIONALITY
The key in the dependency node'scustom dataunder which the optional flag of the dependency before derivation and conflict resolution is stored.- See Also:
-
-
Constructor Details
-
ConflictResolver
public ConflictResolver(ConflictResolver.VersionSelector versionSelector, ConflictResolver.ScopeSelector scopeSelector, ConflictResolver.OptionalitySelector optionalitySelector, ConflictResolver.ScopeDeriver scopeDeriver) Creates a new conflict resolver instance with the specified hooks.- Parameters:
versionSelector- The version selector to use, must not benull.scopeSelector- The scope selector to use, must not benull.optionalitySelector- The optionality selector ot use, must not benull.scopeDeriver- The scope deriver to use, must not benull.
-
-
Method Details
-
transformGraph
public org.eclipse.aether.graph.DependencyNode transformGraph(org.eclipse.aether.graph.DependencyNode node, org.eclipse.aether.collection.DependencyGraphTransformationContext context) throws org.eclipse.aether.RepositoryException - Specified by:
transformGraphin interfaceorg.eclipse.aether.collection.DependencyGraphTransformer- Throws:
org.eclipse.aether.RepositoryException
-