Package org.openrewrite.maven.tree
Class DependencyNotation
java.lang.Object
org.openrewrite.maven.tree.DependencyNotation
Utility class for parsing and formatting Gradle-style dependency notation strings.
This class is separate from
Dependency to avoid classloading issues in parent-loaded contexts.-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable DependencyParses a Gradle-style dependency string notation into a Dependency object.static StringtoStringNotation(Dependency dependency) Returns a Gradle-style string notation for the given dependency.
-
Method Details
-
parse
Parses a Gradle-style dependency string notation into a Dependency object.Format:
"group:artifact:version:classifier@extension"All parts are optional except the artifact name. The minimum valid notation is ":artifact".
- Parameters:
notation- a String in the format group:artifact:version:classifier@extension- Returns:
- A corresponding Dependency or null if the notation could not be parsed
-
toStringNotation
Returns a Gradle-style string notation for the given dependency.Format:
"group:name:version:classifier@extension"All parts are optional except the artifact name.
- Parameters:
dependency- the dependency to convert to string notation- Returns:
- the dependency in Gradle string notation
-