openrewrite / openrewrite/rewrite
Create `UpgradeDependencyConstraintVersion` recipe
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 570
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 261
Description
What problem are you trying to solve?
Enable updating dependency constraints which include first orders. In particular, Gradle projects that use the java-platform plugin declare all of their managed dependencies as constraints, so being able to update these build scripts is the goal.
NOTE: I'm considering using constraints for first order dependencies declared in the current project as out of scope even though this recipe would technically work for those cases.
What precondition(s) should be checked before applying this recipe?
I could potentially see restricting the recipe to only build scripts that contain the java-platform plugin, but as the additional note above there is some overlap with a Gradle practice, albeit not a best practice.
Describe the situation before applying the recipe
plugins {
id "java-platform"
}
dependencies {
constraints {
api("com.google.guava:guava:29.0-jre")
}
}
Describe the situation after applying the recipe
plugins {
id "java-platform"
}
dependencies {
constraints {
api("com.google.guava:guava:31.0-jre")
}
}
Have you considered any alternatives or workarounds?
N/A
Any additional context
None
Are you interested in contributing this recipe to OpenRewrite?
Always.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the Gradle build-script example in the issue and verify how the java-platform plugin represents dependency constraints. Decide whether the recipe should require that plugin or also handle first-order project constraints. Done means updating the constraint version from 29.0-jre to 31.0-jre without changing unrelated declarations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100