Class DefaultDependency

java.lang.Object
org.apache.maven.internal.impl.AetherDependencyWrapper
org.apache.maven.internal.impl.DefaultDependency
All Implemented Interfaces:
Artifact, Dependency

public class DefaultDependency extends AetherDependencyWrapper implements Dependency
  • Field Details

    • key

      private final String key
  • Constructor Details

  • Method Details

    • key

      public String key()
      Description copied from interface: Artifact
      Returns a unique identifier for this artifact. The identifier is composed of groupId, artifactId, extension, classifier, and version.
      Specified by:
      key in interface Artifact
      Returns:
      a unique identifier for this artifact
      See Also:
    • getVersion

      public Version getVersion()
      Description copied from interface: Artifact
      Returns the version of the artifact. Contrarily to ArtifactCoordinates, each Artifact is associated to a specific version instead of a range of versions. If the base version contains a meta-version such as SNAPSHOT, those keywords are replaced by, for example, the actual timestamp.
      Specified by:
      getVersion in interface Artifact
      Returns:
      the version of the artifact
      See Also:
    • getBaseVersion

      public Version getBaseVersion()
      Description copied from interface: Artifact
      Returns the version or meta-version of the artifact. A meta-version is a version suffixed with the SNAPSHOT keyword. Meta-versions are represented in a base version by their symbols (e.g., SNAPSHOT), while they are replaced by, for example, the actual timestamp in the version.
      Specified by:
      getBaseVersion in interface Artifact
      Returns:
      the version or meta-version of the artifact
    • isSnapshot

      public boolean isSnapshot()
      Description copied from interface: Artifact
      Determines whether this artifact uses a snapshot version.
      Specified by:
      isSnapshot in interface Artifact
      Returns:
      true if the artifact is a snapshot, false otherwise
      See Also:
    • isOptional

      public boolean isOptional()
      Description copied from interface: Dependency
      Returns whether the dependency is optional or mandatory. Contrarily to DependencyCoordinates, the obligation of a Dependency is always present. The value is computed during the dependencies collection phase.
      Specified by:
      isOptional in interface Dependency
      Returns:
      true if the dependency is optional, or false if mandatory
      See Also:
    • toCoordinates

      @Nonnull public DependencyCoordinates toCoordinates()
      Description copied from interface: Dependency
      Returns coordinates with the same identifiers as this dependency.
      Specified by:
      toCoordinates in interface Artifact
      Specified by:
      toCoordinates in interface Dependency
      Returns:
      coordinates with the same identifiers as this dependency
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object