Class ResolverUtil


  • @Named
    class ResolverUtil
    extends java.lang.Object
    Resolver helper class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.aether.RepositorySystem repositorySystem  
      private org.apache.maven.execution.MavenSession session  
    • Constructor Summary

      Constructors 
      Constructor Description
      ResolverUtil​(org.eclipse.aether.RepositorySystem repositorySystem, org.apache.maven.execution.MavenSession session)
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.CharSequence dumpTree​(org.eclipse.aether.graph.DependencyNode rootNode)
      Dump a DependencyNode as a tree.
      (package private) org.eclipse.aether.graph.DependencyNode resolveTransitiveDependencies()
      Retrieves the DependencyNode instance containing the result of the transitive dependency for the current MavenProject.
      private org.eclipse.aether.graph.DependencyNode resolveTransitiveDependencies​(boolean verbose, boolean excludeOptional, java.util.List<java.lang.String> excludedScopes)  
      (package private) org.eclipse.aether.graph.DependencyNode resolveTransitiveDependencies​(boolean excludeOptional, java.util.List<java.lang.String> excludedScopes)
      Retrieves the DependencyNode instance containing the result of the transitive dependency for the current MavenProject.
      (package private) org.eclipse.aether.graph.DependencyNode resolveTransitiveDependenciesVerbose​(java.util.List<java.lang.String> excludedScopes)
      Retrieves the DependencyNode instance containing the result of the transitive dependency for the current MavenProject in verbose mode.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • repositorySystem

        private final org.eclipse.aether.RepositorySystem repositorySystem
      • session

        private final org.apache.maven.execution.MavenSession session
    • Constructor Detail

      • ResolverUtil

        @Inject
        ResolverUtil​(org.eclipse.aether.RepositorySystem repositorySystem,
                     org.apache.maven.execution.MavenSession session)
        Default constructor
    • Method Detail

      • resolveTransitiveDependenciesVerbose

        org.eclipse.aether.graph.DependencyNode resolveTransitiveDependenciesVerbose​(java.util.List<java.lang.String> excludedScopes)
                                                                              throws EnforcerRuleException
        Retrieves the DependencyNode instance containing the result of the transitive dependency for the current MavenProject in verbose mode.

        In verbose mode all nodes participating in a conflict are retained.

        Please consult ConflictResolver and DependencyManagerUtils>

        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 EnforcerRuleException
        Retrieves the DependencyNode instance containing the result of the transitive dependency for the current MavenProject.
        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,
                                                                              java.util.List<java.lang.String> excludedScopes)
                                                                       throws EnforcerRuleException
        Retrieves the DependencyNode instance containing the result of the transitive dependency for the current MavenProject.
        Parameters:
        excludeOptional - ignore optional project artifacts
        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

        private org.eclipse.aether.graph.DependencyNode resolveTransitiveDependencies​(boolean verbose,
                                                                                      boolean excludeOptional,
                                                                                      java.util.List<java.lang.String> excludedScopes)
                                                                               throws EnforcerRuleException
        Throws:
        EnforcerRuleException
      • dumpTree

        public java.lang.CharSequence dumpTree​(org.eclipse.aether.graph.DependencyNode rootNode)
        Dump a DependencyNode as a tree.
        Parameters:
        rootNode - node to inspect
        Returns:
        dependency tree as String