openrewrite / openrewrite/rewrite

Maven: Add ChangeManagedDependencyClassifier

Open
#3,830 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

maven recipe
Dominant language
Java
Stars
3.7k
Forks
570
Avg merge
13h 12m
Merged PRs (30d)
261

Description

Currently there is https://github.com/openrewrite/rewrite/blob/main/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyClassifier.java

Which changes a Maven Dependency classifier for example:

From:

<dependency>
	<groupId>org.primefaces</groupId>
	<artifactId>primefaces</artifactId>
	<version>13.0.3</version>
</dependency>

To: (Add classifier jakarta)

<dependency>
	<groupId>org.primefaces</groupId>
	<artifactId>primefaces</artifactId>
	<version>13.0.3</version>
        <classifier>jakarta</classifier>
</dependency>

However there is no ChangeManagedDependencyClassifier to change a managed dependency classifier? Ideally the above JAVA should do both at the same time or a new ChangeManagedDependencyClassifier could be introduced which is exactly like ChangeDependencyClassifier which a few lines of code changed to check for Managed depenency.

Contributor guide

Open the contributing guide

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.

Research direction

Start with rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyClassifier.java and compare its handling with Maven managed dependencies. Add equivalent classifier-changing behavior for managed dependencies, then verify that a dependency in dependencyManagement receives the requested classifier.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.