Reference spotless support in the readme
Reference spotless support in the readme
@@ -8,6 +8,7 @@ _A modern, lambda-friendly, 120 character Java formatter._
- [IntelliJ plugin](https://plugins.jetbrains.com/plugin/13180-palantir-java-format)
- [Gradle plugin](https://github.com/palantir/gradle-baseline#compalantirbaseline-format)
+- [Maven plugin via Spotless](#maven-integration-via-spotless)
It is based on the excellent [google-java-format](https://github.com/google/google-java-format), and benefits from the work of all the [original authors](https://github.com/google/google-java-format/graphs/contributors). palantir-java-format is available under the same [Apache 2.0 License](./LICENSE).
@@ -133,6 +134,27 @@ allprojects {
}
```
+## Maven Integration via Spotless
+
+palantir-java-format is supported by [spotless](https://github.com/diffplug/spotless/blob/main/plugin-maven/README.md#palantir-java-format)
+out of the box.
+
+```xml
+<plugin>
+ <groupId>com.diffplug.spotless</groupId>
+ <artifactId>spotless-maven-plugin</artifactId>
+ <version>${spotless.version}</version>
+ <configuration>
+ <java>
+ <palantirJavaFormat>
+ <!-- Optionally specify a version -->
+ <version>${palantirJavaFormat.version}</version>
+ </palantirJavaFormat>
+ </java>
+ </configuration>
+</plugin>
+```
+
Applying this automatically configures IntelliJ, whether you run `./gradlew idea`
or import the project directly from IntelliJ, to use the correct version of the formatter
when formatting java code.
