openrewrite / openrewrite/rewrite

Maven: openrewrite should support AddModule / RemoveModule

Open
#4,759 3 comments 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

What problem are you trying to solve?

OpenRewrite has recipes that add and remove plugins / dependencies / etc. Openrewrite should also be able to add or remove a <module/> to a pom's <modules/>

What precondition(s) should be checked before applying this recipe?

Describe the situation before applying the recipe

For AddModule - the situation before applying the recipe might be

<modules>
    <module>foo</module>
</modules>

Describe the situation after applying the recipe

For AddModule - the situation after applying the recipe to add a "bar" module would be

<modules>
    <module>foo</module>
    <module>bar</module>
</modules>

Have you considered any alternatives or workarounds?

Any additional context

Are you interested in contributing this recipe to OpenRewrite?

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

No file, test, or entry point is named. Start by locating the existing recipes for adding or removing Maven plugins or dependencies, then identify how module entries in a pom are represented and tested. Done means AddModule can add the requested module and RemoveModule can remove one, while preserving the demonstrated module structure.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.