Interface Dependency

All Superinterfaces:
Artifact
All Known Subinterfaces:
DownloadedDependency

@Experimental @Immutable public interface Dependency extends Artifact
A result of collecting, flattening, and resolving DependencyCoordinatess. Dependency is the output of the collection process, which builds the graph of dependencies, followed by flattening and resolution. The version selection is done for each dependency during the collection phase. The flatten phase keeps only a single version per (groupId, artifactId) pair. The resolution phase actually downloads the dependencies (or artifacts) that have been computed.
Since:
4.0.0
  • Method Details

    • getType

      @Nonnull Type getType()
      Returns the type of the dependency. A dependency can be a JAR file, a modular-JAR if it is intended to be placed on the module path, a JAR containing test classes, etc.
      Returns:
      the type of the dependency
      See Also:
    • getScope

      @Nonnull DependencyScope getScope()
      Returns the time at which the dependency will be used. It may be, for example, at compile time only, at run time or at test time.
      Returns:
      the time at which the dependency will be used
      See Also:
    • isOptional

      boolean isOptional()
      Returns whether the dependency is optional or mandatory. Unlike DependencyCoordinates, the obligation of a Dependency is always present. The value is computed during the dependencies collection phase.
      Returns:
      true if the dependency is optional, or false if mandatory
      See Also:
    • toCoordinates

      @Nonnull DependencyCoordinates toCoordinates()
      Returns coordinates with the same identifiers as this dependency.
      Specified by:
      toCoordinates in interface Artifact
      Returns:
      coordinates with the same identifiers as this dependency
      See Also: