Open
Description
Gradle ChangeDependency shows following result, if new dependency was already defined:
rewriteRun(
spec -> spec.recipe(new ChangeDependency("commons-lang", "commons-lang", "org.apache.commons", "commons-lang3", "3.11.x", null, null)),
buildGradle(
"""
plugins {
id "java-library"
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.apache.commons:commons-lang3:2.6"
implementation group: "org.apache.commons", name: "commons-lang3", version: "2.6"
implementation "org.apache.commons:commons-lang3:3.11"
}
""",
"""
plugins {
id "java-library"
}
repositories {
mavenCentral()
}
dependencies {
implementation "commons-lang:commons-lang:2.6"
implementation group: "org.apache.commons", name: "commons-lang3", version: "2.6"
implementation "org.apache.commons:commons-lang3:3.11"
}
"""
Recipe replaced commons-lang:commons-lang with new groupId and artifactId, but kept the version from old dependency.
Expected behavior will be just remove old dependency in this case:
implementation "org.apache.commons:commons-lang3:3.11"
Metadata
Assignees
Labels
Type
Projects
Status
Backlog
Activity