GitHub - openrewrite/rewrite-maven-plugin: OpenRewrite's Maven plugin. (original) (raw)
What is this?
This project provides a Maven plugin that applies 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:
To configure, add the plugin to your POM:
... org.openrewrite.maven rewrite-maven-plugin org.openrewrite.java.format.AutoFormatIf wanting to leverage recipes from other dependencies:
... 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-actionsTo get started, try mvn rewrite:help, mvn rewrite:discover, mvn rewrite:dryRun, mvn rewrite:run, among other plugin goals.
See the Maven Plugin Configuration documentation for full configuration and usage options.
Snapshots
To use the latest -SNAPSHOT version, add a <pluginRepositories> entry for OSSRH snapshots. For example:
<pluginRepositories>
<pluginRepository>
<id>ossrh-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots</url>
</pluginRepository>
</pluginRepositories>
Notes for developing and testing this plugin
This plugin uses the Maven Integration Testing Framework Extension for tests.
All tests can be run from the command line using:
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 for information, too. It's good.
Contributing
We appreciate all types of contributions. See the contributing guide 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