-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add short explanation of multi-module maven + rewrite (#201)
* Add short explanation of multi-module maven + rewrite Fixes: #129 * Minor clarification based on Tim's suggestion --------- Co-authored-by: Mike Sol <[email protected]>
- Loading branch information
1 parent
7f09d88
commit acc2bf8
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Running OpenRewrite on a multi-module Maven project | ||
|
||
If you have a Maven project with multiple modules, you may run into errors finding and running the [OpenRewrite Maven plugin](https://github.com/openrewrite/rewrite-maven-plugin). | ||
|
||
There is currently an [open issue](https://github.com/openrewrite/rewrite-maven-plugin/issues/475) to better support multi-module Maven projects that you can +1 on if you'd like. | ||
|
||
In the meantime, one way to work around this is to add a profile on the parent POM: | ||
|
||
```xml | ||
<profile> | ||
<id>openrewrite</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.openrewrite.maven</groupId> | ||
<artifactId>rewrite-maven-plugin</artifactId> | ||
<version>5.2.6</version> | ||
<configuration> | ||
<activeRecipes> | ||
<recipe>org.openrewrite.java.cleanup.Cleanup</recipe> | ||
</activeRecipes> | ||
<failOnDryRunResults>true</failOnDryRunResults> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
``` | ||
|
||
You can then run OpenRewrite from any submodule using this command: `mvn -Popenrewrite rewrite:run`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters