Package org.openrewrite.maven.tree
Enum Class Scope
- All Implemented Interfaces:
Serializable,Comparable<Scope>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringasConsumableGradleConfigurationName(@Nullable Scope scope) Use when you want to know which Gradle configuration you should *add* an entry to in order to most closely match a given Maven scope.static @Nullable StringasGradleConfigurationName(@Nullable Scope scope) Deprecated.static @Nullable StringasResolvableGradleConfigurationName(@Nullable Scope scope) Use when you want to know which Gradle configuration you should *read* to get contents similar to a given Maven scope.static ScopebooleanisInClasspathOf(@Nullable Scope scope) static @Nullable ScopemaxPrecedence(@Nullable Scope scope1, @Nullable Scope scope2) Give two scopes, returns the scope with the highest precedence.@Nullable ScopetransitiveOf(@Nullable Scope scope) static ScopeReturns the enum constant of this class with the specified name.static Scope[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
None
-
Compile
-
Provided
-
Runtime
-
Test
-
System
-
Import
-
Invalid
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
isInClasspathOf
- Parameters:
scope- The scope to test- Returns:
- If a dependency in this scope would be in the classpath of the tested scope.
-
transitiveOf
See the table at https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope.thisrepresents the scope on the top row of the table.- Parameters:
scope- The scope on the left column of the table.- Returns:
- The scope inside the table.
-
fromName
-
maxPrecedence
Give two scopes, returns the scope with the highest precedence.- Returns:
- Scope with the higher precedence.
-
asGradleConfigurationName
Deprecated.There are more, and more complex, gradle dependency configurations than there are maven scopes. In Maven you place a dependency that should be available at runtime but not at compile time into the "runtime" scope. In Gradle you place a dependency that should be available at runtime but not at compile time into the "runtimeOnly" configuration. In this situation you should useasConsumableGradleConfigurationName(org.openrewrite.maven.tree.Scope). In Maven you read the runtime classpath from the "runtime" scope. In Gradle you read the runtime classpath from the "runtimeClasspath" configuration. In this situation you should useasResolvableGradleConfigurationName(org.openrewrite.maven.tree.Scope). This method is deprecated because its name is ambiguous about which of these possible mappings it is referring to. -
asConsumableGradleConfigurationName
Use when you want to know which Gradle configuration you should *add* an entry to in order to most closely match a given Maven scope. -
asResolvableGradleConfigurationName
Use when you want to know which Gradle configuration you should *read* to get contents similar to a given Maven scope.
-