From fc1f23573df7aa846eced47240a03103cbdf7dc4 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Fri, 25 Sep 2026 23:57:45 +0300 Subject: [PATCH] Show the Maven plugin in the README dev.openjavaformat:fmt-maven-plugin 2.27.0.1 is on Maven Central, released from openjavaformat/fmt-maven-plugin, and openjavaformat.dev has a Get started page for it. The README now names it among the Maven Central artifacts, links that page, and shows the plugin block a pom.xml needs. The block names the open-java-format version as well, because the plugin brings no formatter of its own and a build without the dependency stops. The snippet was run against the published 2.27.0.1 with 2.98.0.4. --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9553d8968..883f53ab1 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ and published from this repository. | Where | What | |---|---| -| [Maven Central](https://central.sonatype.com/namespace/dev.openjavaformat) | `dev.openjavaformat:open-java-format`, with `-spi`, `-native` and `-jdk-bootstrap` | +| [Maven Central](https://central.sonatype.com/namespace/dev.openjavaformat) | `dev.openjavaformat:open-java-format`, with `-spi`, `-native` and `-jdk-bootstrap`, and the Maven plugin `dev.openjavaformat:fmt-maven-plugin` from [its own repository](https://github.com/openjavaformat/fmt-maven-plugin) | | [Gradle Plugin Portal](https://plugins.gradle.org/plugin/dev.openjavaformat.java-format) | `dev.openjavaformat.java-format` | | [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/34359-open-java-format) | the IntelliJ IDEA plugin | | [GitHub Releases](https://github.com/openjavaformat/open-java-format/releases/latest) | native binaries, a runnable jar, the Gradle, IntelliJ and Eclipse plugins, every file signed | @@ -32,11 +32,39 @@ Why the project exists is in the [manifesto](https://openjavaformat.dev/manifest Each page is short and every command on it was run against the published artifacts. - [Gradle plugin](https://openjavaformat.dev/get-started/gradle/) +- [Maven plugin](https://openjavaformat.dev/get-started/maven/) - [Command line](https://openjavaformat.dev/get-started/command-line/): a native binary, or a runnable jar - [IntelliJ IDEA](https://openjavaformat.dev/get-started/intellij-idea/) - [Eclipse](https://openjavaformat.dev/get-started/eclipse/) - [GitHub Action and pre-commit hook](https://openjavaformat.dev/get-started/github-actions/) +With Maven, add the plugin and name the open-java-format version it formats with. The plugin brings +no formatter of its own, so the dependency is required: + +```xml + + dev.openjavaformat + fmt-maven-plugin + 2.27.0.1 + + + + format + + + + + + dev.openjavaformat + open-java-format + 2.98.0.4 + + + +``` + +`format` rewrites the sources before they are compiled; the `check` goal fails the build instead. + ## What the output looks like Lines are up to 120 characters wide. A lambda stays on the line where it starts, and a long call