https://github.com/openrewrite/rewrite-maven-plugin
OpenRewrite's Maven plugin.
https://github.com/openrewrite/rewrite-maven-plugin
openrewrite
Last synced: 5 months ago
JSON representation
OpenRewrite's Maven plugin.
- Host: GitHub
- URL: https://github.com/openrewrite/rewrite-maven-plugin
- Owner: openrewrite
- Created: 2020-05-20T03:53:11.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2026-01-14T21:00:41.000Z (5 months ago)
- Last Synced: 2026-01-15T00:29:53.454Z (5 months ago)
- Topics: openrewrite
- Language: Java
- Homepage: https://openrewrite.github.io/rewrite-maven-plugin/plugin-info.html
- Size: 2.17 MB
- Stars: 173
- Watchers: 5
- Forks: 89
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE/apache-license-v2.txt
Awesome Lists containing this project
README
rewrite-maven-plugin
[](https://github.com/openrewrite/rewrite-maven-plugin/actions/workflows/ci.yml)
[](https://mvnrepository.com/artifact/org.openrewrite.maven/rewrite-maven-plugin)
[](https://github.com/openrewrite/.github/blob/main/CONTRIBUTING.md)
## What is this?
This project provides a Maven plugin that applies [Rewrite](https://github.com/openrewrite/rewrite) checking and fixing tasks as build tasks, one of several possible workflows for propagating change across an organization's source code.
## Getting started
This `README` may not have the most up-to-date documentation. For the most up-to-date documentation and reference guides, see:
- [Auto-generated maven plugin documentation](https://openrewrite.github.io/rewrite-maven-plugin/plugin-info.html)
- [Maven Plugin Configuration](https://docs.openrewrite.org/reference/rewrite-maven-plugin)
- [OpenRewrite Quickstart Guide](https://docs.openrewrite.org/running-recipes/getting-started)
To configure, add the plugin to your POM:
```xml
...
org.openrewrite.maven
rewrite-maven-plugin
org.openrewrite.java.format.AutoFormat
```
If wanting to leverage recipes from other dependencies:
```xml
...
org.openrewrite.maven
rewrite-maven-plugin
org.openrewrite.java.testing.junit5.JUnit5BestPractices
org.openrewrite.github.ActionsSetupJavaAdoptOpenJDKToTemurin
org.openrewrite.recipe
rewrite-testing-frameworks
org.openrewrite.recipe
rewrite-github-actions
```
To get started, try `mvn rewrite:help`, `mvn rewrite:discover`, `mvn rewrite:dryRun`, `mvn rewrite:run`, among other plugin goals.
See the [Maven Plugin Configuration](https://docs.openrewrite.org/reference/rewrite-maven-plugin) documentation for full configuration and usage options.
### Snapshots
To use the latest `-SNAPSHOT` version, add a `` entry for OSSRH snapshots. For example:
```xml
...
org.openrewrite.maven
rewrite-maven-plugin
4.17.0-SNAPSHOT
org.openrewrite.java.logging.slf4j.Log4j2ToSlf4j
org.openrewrite.recipe
rewrite-testing-frameworks
1.1.0-SNAPSHOT
ossrh-snapshots
https://central.sonatype.com/repository/maven-snapshots
```
## Notes for developing and testing this plugin
This plugin uses the [`Maven Integration Testing Framework Extension`](https://github.com/khmarbaise/maven-it-extension) for tests.
All tests can be run from the command line using:
```sh
./mvnw verify
```
If you're looking for more information on the output from a test, try checking the `target/maven-it/**/*IT/**` directory contents after running the tests. It will contain the project state output, including maven logs, etc. Check the [`Integration Testing Framework Users Guide`](https://khmarbaise.github.io/maven-it-extension/itf-documentation/usersguide/usersguide.html) for information, too. It's good.
## Contributing
We appreciate all types of contributions. See the [contributing guide](https://github.com/openrewrite/.github/blob/main/CONTRIBUTING.md) for detailed instructions on how to get started.
### Resource guides
- https://blog.soebes.io/posts/2020/08/2020-08-17-itf-part-i/
- https://carlosvin.github.io/posts/creating-custom-maven-plugin/en/#_dependency_injection
- https://developer.okta.com/blog/2019/09/23/tutorial-build-a-maven-plugin
- https://medium.com/swlh/step-by-step-guide-to-developing-a-custom-maven-plugin-b6e3a0e09966