Class ResolverUtil
java.lang.Object
org.apache.maven.enforcer.rules.dependency.ResolverUtil
Resolver helper class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.eclipse.aether.RepositorySystemprivate final org.apache.maven.execution.MavenSession -
Constructor Summary
ConstructorsConstructorDescriptionResolverUtil(org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.execution.MavenSession session) Default constructor -
Method Summary
Modifier and TypeMethodDescriptiondumpTree(org.eclipse.aether.graph.DependencyNode rootNode) Dump aDependencyNodeas a tree.(package private) org.eclipse.aether.graph.DependencyNodeRetrieves theDependencyNodeinstance containing the result of the transitive dependency for the currentMavenProject.private org.eclipse.aether.graph.DependencyNoderesolveTransitiveDependencies(boolean verbose, boolean excludeOptional, List<String> excludedScopes) (package private) org.eclipse.aether.graph.DependencyNoderesolveTransitiveDependencies(boolean excludeOptional, List<String> excludedScopes) Retrieves theDependencyNodeinstance containing the result of the transitive dependency for the currentMavenProject.(package private) org.eclipse.aether.graph.DependencyNoderesolveTransitiveDependenciesVerbose(List<String> excludedScopes) Retrieves theDependencyNodeinstance containing the result of the transitive dependency for the currentMavenProjectin verbose mode.
-
Field Details
-
repositorySystem
private final org.eclipse.aether.RepositorySystem repositorySystem -
session
private final org.apache.maven.execution.MavenSession session
-
-
Constructor Details
-
ResolverUtil
@Inject ResolverUtil(org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.execution.MavenSession session) Default constructor
-
-
Method Details
-
resolveTransitiveDependenciesVerbose
org.eclipse.aether.graph.DependencyNode resolveTransitiveDependenciesVerbose(List<String> excludedScopes) throws EnforcerRuleException Retrieves theDependencyNodeinstance containing the result of the transitive dependency for the currentMavenProjectin verbose mode.In verbose mode all nodes participating in a conflict are retained.
Please consult
ConflictResolverandDependencyManagerUtils>- Parameters:
excludedScopes- the scopes of direct dependencies to ignore- Returns:
- a Dependency Node which is the root of the project's dependency tree
- Throws:
EnforcerRuleException- thrown if the lookup fails
-
resolveTransitiveDependencies
org.eclipse.aether.graph.DependencyNode resolveTransitiveDependencies() throws EnforcerRuleExceptionRetrieves theDependencyNodeinstance containing the result of the transitive dependency for the currentMavenProject.- Returns:
- a Dependency Node which is the root of the project's dependency tree
- Throws:
EnforcerRuleException- thrown if the lookup fails
-
resolveTransitiveDependencies
org.eclipse.aether.graph.DependencyNode resolveTransitiveDependencies(boolean excludeOptional, List<String> excludedScopes) throws EnforcerRuleException Retrieves theDependencyNodeinstance containing the result of the transitive dependency for the currentMavenProject.- Parameters:
excludeOptional- ignore optional project artifactsexcludedScopes- the scopes of direct dependencies to ignore- Returns:
- a Dependency Node which is the root of the project's dependency tree
- Throws:
EnforcerRuleException- thrown if the lookup fails
-
resolveTransitiveDependencies
private org.eclipse.aether.graph.DependencyNode resolveTransitiveDependencies(boolean verbose, boolean excludeOptional, List<String> excludedScopes) throws EnforcerRuleException - Throws:
EnforcerRuleException
-
dumpTree
Dump aDependencyNodeas a tree.- Parameters:
rootNode- node to inspect- Returns:
- dependency tree as String
-