Class DefaultDependencyResolverResult

java.lang.Object
org.apache.maven.impl.DefaultDependencyResolverResult
All Implemented Interfaces:
org.apache.maven.api.services.DependencyResolverResult, org.apache.maven.api.services.Result<org.apache.maven.api.services.DependencyResolverRequest>

public class DefaultDependencyResolverResult extends Object implements org.apache.maven.api.services.DependencyResolverResult
The result of collecting dependencies with a dependency resolver. New instances are initially empty. Callers must populate with calls to the following methods, in that order:
  • addOutputDirectory(Path, Path) (optional)
  • addDependency(Node, Dependency, Predicate, Path)
See Also:
  • Constructor Details

    • DefaultDependencyResolverResult

      public DefaultDependencyResolverResult(org.apache.maven.api.services.DependencyResolverRequest request, List<Exception> exceptions, org.apache.maven.api.Node root, int count)
      Creates an initially empty result with a temporary cache. Callers should add path elements by calls to addDependency(Node, Dependency, Predicate, Path).

      WARNING: this constructor may be removed in a future Maven release. The reason is because DefaultDependencyResolverResult needs a cache, which should preferably be session-wide. How to manage such caches has not yet been clarified.

      Parameters:
      request - the corresponding request
      exceptions - the exceptions that occurred while building the dependency graph
      root - the root node of the dependency graph
      count - estimated number of dependencies
  • Method Details

    • getRequest

      public org.apache.maven.api.services.DependencyResolverRequest getRequest()
      Specified by:
      getRequest in interface org.apache.maven.api.services.Result<org.apache.maven.api.services.DependencyResolverRequest>
    • getExceptions

      public List<Exception> getExceptions()
      Specified by:
      getExceptions in interface org.apache.maven.api.services.DependencyResolverResult
    • getRoot

      public org.apache.maven.api.Node getRoot()
      Specified by:
      getRoot in interface org.apache.maven.api.services.DependencyResolverResult
    • getNodes

      public List<org.apache.maven.api.Node> getNodes()
      Specified by:
      getNodes in interface org.apache.maven.api.services.DependencyResolverResult
    • getPaths

      public List<Path> getPaths()
      Specified by:
      getPaths in interface org.apache.maven.api.services.DependencyResolverResult
    • getDispatchedPaths

      public Map<org.apache.maven.api.PathType,List<Path>> getDispatchedPaths()
      Specified by:
      getDispatchedPaths in interface org.apache.maven.api.services.DependencyResolverResult
    • getDependencies

      public Map<org.apache.maven.api.Dependency,Path> getDependencies()
      Specified by:
      getDependencies in interface org.apache.maven.api.services.DependencyResolverResult
    • getModuleDescriptor

      public Optional<ModuleDescriptor> getModuleDescriptor(Path dependency) throws IOException
      Specified by:
      getModuleDescriptor in interface org.apache.maven.api.services.DependencyResolverResult
      Throws:
      IOException
    • getModuleName

      public Optional<String> getModuleName(Path dependency) throws IOException
      Specified by:
      getModuleName in interface org.apache.maven.api.services.DependencyResolverResult
      Throws:
      IOException
    • warningForFilenameBasedAutomodules

      public Optional<String> warningForFilenameBasedAutomodules()
      Specified by:
      warningForFilenameBasedAutomodules in interface org.apache.maven.api.services.DependencyResolverResult