Class Maven31DirectScopeDependencySelector

java.lang.Object
org.apache.maven.shared.dependency.graph.internal.maven31.Maven31DirectScopeDependencySelector
All Implemented Interfaces:
org.eclipse.aether.collection.DependencySelector

public class Maven31DirectScopeDependencySelector extends Object implements org.eclipse.aether.collection.DependencySelector
A dependency selector that excludes dependencies of an specific Scope which occur beyond level one of the dependency graph.
Since:
3.1.0
See Also:
  • Dependency.getScope()
  • Field Details

    • scope

      private final String scope
    • depth

      private final int depth
  • Constructor Details

    • Maven31DirectScopeDependencySelector

      public Maven31DirectScopeDependencySelector(String scope)
    • Maven31DirectScopeDependencySelector

      private Maven31DirectScopeDependencySelector(String scope, int depth)
  • Method Details

    • selectDependency

      public boolean selectDependency(org.eclipse.aether.graph.Dependency dependency)
      Decides whether the specified dependency should be included in the dependency graph.
      Specified by:
      selectDependency in interface org.eclipse.aether.collection.DependencySelector
      Parameters:
      dependency - The dependency to check, must not be null.
      Returns:
      false if the dependency should be excluded from the children of the current node, true otherwise.
    • deriveChildSelector

      public org.eclipse.aether.collection.DependencySelector deriveChildSelector(org.eclipse.aether.collection.DependencyCollectionContext context)
      Derives a dependency selector for the specified collection context. When calculating the child selector, implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
      Specified by:
      deriveChildSelector in interface org.eclipse.aether.collection.DependencySelector
      Parameters:
      context - The dependency collection context, must not be null.
      Returns:
      The dependency selector for the target node, must not be null.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object