Enum Class DependencyScope

java.lang.Object
java.lang.Enum<DependencyScope>
org.apache.maven.api.DependencyScope
All Implemented Interfaces:
Serializable, Comparable<DependencyScope>, Constable

@Experimental @Immutable public enum DependencyScope extends Enum<DependencyScope>
Dependency scope. This represents at which time the dependency will be used, for example, at compile time only, at run time or at test time. For a given dependency, the scope is directly derived from the Dependency.getScope() and will be used when using PathScope and the DependencyResolver.
Since:
4.0.0
See Also:
  • Enum Constant Details

    • NONE

      public static final DependencyScope NONE
      None. Allows you to declare dependencies (for example to alter reactor build order) but in reality dependencies in this scope are not part of any path scope.
    • UNDEFINED

      public static final DependencyScope UNDEFINED
      Undefined. When no scope is explicitly given, UNDEFINED will be used, but its meaning will depend on whether the DependencyCoordinate is used in dependency management, in which case it means the scope is not explicitly managed by this managed dependency, or as a real dependency, in which case, the scope will default to COMPILE.
    • COMPILE_ONLY

      public static final DependencyScope COMPILE_ONLY
      Compile only.
    • COMPILE

      public static final DependencyScope COMPILE
      Compile, runtime and test.
    • RUNTIME

      public static final DependencyScope RUNTIME
      Runtime and test.
    • PROVIDED

      public static final DependencyScope PROVIDED
      Provided.
    • TEST_ONLY

      public static final DependencyScope TEST_ONLY
      Test compile only.
    • TEST

      public static final DependencyScope TEST
      Test compile and test runtime.
    • TEST_RUNTIME

      public static final DependencyScope TEST_RUNTIME
      Test runtime.
    • SYSTEM

      public static final DependencyScope SYSTEM
      System scope.

      Important: this scope id MUST BE KEPT in sync with label in org.eclipse.aether.util.artifact.DependencyScopes#SYSTEM.

  • Method Details

    • values

      public static DependencyScope[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DependencyScope valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • forId

      public static DependencyScope forId(String id)
    • id

      @Nonnull public String id()
      The id uniquely represents a value for this extensible enum. This id should be used to compute the equality and hash code for the instance.
      Returns:
      the id
    • isTransitive

      public boolean isTransitive()
    • is

      public boolean is(String id)