Support Gradle wildcard version or placeholder variable in dependency management recipes

Open
#182 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
build-system

Research direction

Start at the AddDependency recipe and related dependency management recipes, then trace how version values are interpreted and rendered. Verify the desired behavior by checking that a version such as 1.2.+ is preserved correctly in the resulting added dependency; placeholder support may require separate scope clarification.

Written by the indexing model from the issue text.

Description

enhancement

What problem are you trying to solve?

My organization regularly wildcards the patch version for projects rather than using an explicit version as it helps to avoid the churn of versioning artifacts explicitly, but we use OpenRewrite to change the versions of several artifacts at once across many repositories. We'd like to have the ability to specify a version of a.b.+ to better support this. We also use placeholders in several locations (i.e. a version of ${dependencyVersion}) which would also be helpful but might be out-of-scope for this issue. I can open another issue for this work if you'd like.

Describe the solution you'd like

When running the AddDependency recipe (or other dependency management recipes), I'd like to be able to specify version: 1.2.+ and have the resulting added dependency be wildcarded properly.

Have you considered any alternatives or workarounds?

A rawVersion property or similar would be just as useful and would allow for wildcarding and for placeholders.

Are you interested in contributing this feature to OpenRewrite?

I'd be interested in contributing but given how busy I am I likely won't be able to work on it anytime soon. I'll update if I find time to work on this.

Dominant language
Java
Stars
18
Forks
12
Avg merge
55m
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openrewrite/rewrite-java-dependencies

All issues in openrewrite/rewrite-java-dependencies

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.