https://github.com/openrewrite/rewrite-gradle-plugin
OpenRewrite's Gradle plugin.
https://github.com/openrewrite/rewrite-gradle-plugin
openrewrite
Last synced: 5 months ago
JSON representation
OpenRewrite's Gradle plugin.
- Host: GitHub
- URL: https://github.com/openrewrite/rewrite-gradle-plugin
- Owner: openrewrite
- Created: 2020-05-13T22:02:11.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2026-01-16T12:40:56.000Z (5 months ago)
- Last Synced: 2026-01-17T03:25:35.476Z (5 months ago)
- Topics: openrewrite
- Language: Java
- Homepage:
- Size: 1.69 MB
- Stars: 79
- Watchers: 6
- Forks: 48
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE/apache-license-v2.txt
Awesome Lists containing this project
README
rewrite-gradle-plugin
[](https://github.com/openrewrite/rewrite-gradle-plugin/actions/workflows/ci.yml)
[](https://plugins.gradle.org/plugin/org.openrewrite.rewrite)
[](https://ge.openrewrite.org/scans)
[](https://github.com/openrewrite/.github/blob/main/CONTRIBUTING.md)
## What is this?
This project provides a Gradle 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.
```groovy
plugins {
id("java")
id("org.openrewrite.rewrite").version("latest_version_here")
}
rewrite {
// Reformats Java Code
activeRecipe("org.openrewrite.java.format.AutoFormat")
}
```
### Consuming latest snapshots from OSSRH
To use the latest `-SNAPSHOT` of the `rewrite-gradle-plugin`, update your project's `settings.gradle.kts`:
```kts
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "org.openrewrite") {
useModule("org.openrewrite:plugin:${requested.version}")
}
}
}
repositories {
// ...
maven {
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
}
// ...
// you'll likely also need this if you don't have a pluginManagement section already:
gradlePluginPortal()
// ...
}
}
```
The plugin can be consumed in your `build.gradle.kts`:
```kts
plugins {
id("org.openrewrite.rewrite") version "X.Y.Z-SNAPSHOT"
// or resolved dynamically to absolute latest:
id("org.openrewrite.rewrite") version "latest.integration"
}
```
## 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.
## Documentation
- [OpenRewrite Quickstart Guide](https://docs.openrewrite.org/running-recipes/getting-started)
- [Gradle Plugin Reference](https://docs.openrewrite.org/reference/gradle-plugin-configuration)