Class AetherDependencyWrapper

java.lang.Object
org.apache.maven.internal.impl.AetherDependencyWrapper
Direct Known Subclasses:
DefaultDependency, DefaultDependencyCoordinates

abstract class AetherDependencyWrapper extends Object
Base class of Dependency or DependencyCoordinates implementations as a wrapper around an Eclipse Aether object. This class implements the methods that are common to Dependency and DependencyCoordinates, even if this class does not implement directly any of those interfaces. Having matching method signatures is sufficient, even if there is no @Override annotations.

The fact that this class is wrapping an Eclipse Aether object is an implementation details that may change in any future Maven version. For now, one purpose of this class is to have a single type to check for unwrapping the Eclipse Aether object.

  • Field Details

    • session

      final InternalSession session
      The session to install / deploy / resolve artifacts and dependencies.
    • dependency

      final org.eclipse.aether.graph.Dependency dependency
      The wrapped Eclipse Aether dependency.
  • Constructor Details

    • AetherDependencyWrapper

      AetherDependencyWrapper(@Nonnull InternalSession session, @Nonnull org.eclipse.aether.graph.Dependency dependency)
      Creates a new wrapper for the given dependency.
      Parameters:
      dependency - the Eclipse Aether dependency to wrap
  • Method Details

    • getGroupId

      public String getGroupId()
      Returns the group identifier of the wrapped dependency. The default implementation delegates to the Eclipse Aether artifact.
      Returns:
      the group identifier of the wrapped dependency
    • getArtifactId

      public String getArtifactId()
      Returns the artifact identifier of the wrapped dependency. The default implementation delegates to the Eclipse Aether artifact.
      Returns:
      the artifact identifier of the wrapped dependency
    • getExtension

      public String getExtension()
      Returns the file extension of the wrapped dependency. The default implementation delegates to the Eclipse Aether artifact.
      Returns:
      the file extension of the wrapped dependency
    • getType

      public Type getType()
      Returns the type of the wrapped dependency. The default implementation infers the type from the properties associated to the Eclipse Aether artifact.
      Returns:
      the type of the wrapped dependency
    • getClassifier

      @Nonnull public String getClassifier()
      Returns the classifier ("jar", "test-jar", …) of the wrapped dependency. The default implementation first delegates to the Eclipse Aether artifact. If the latter does not provide a non-empty classifier, then the default value is determined by type.
      Returns:
      the classifier ("jar", "test-jar", …) of the wrapped dependency
    • getScope

      @Nonnull public DependencyScope getScope()
      Returns the scope (compile, test, …) of this dependency.
      Returns:
      the scope (compile, test, …) of this dependency
    • toString

      public String toString()
      Returns a string representation of this dependency. This is for debugging purposes only and may change in any future version.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this dependency