Skip to content

Change the build file to use spotless so the build works with Java 17 and Java 21

Remi Forax requested to merge use-spotless-to-build-on-17-and-21 into master

Change the build file to replace 'com.github.sherter.google-java-format' by spotless.

Spotless executes the jar of google-java-format as a subprocess instead of using the VM that is running the build. So we can now have a buid that run with Java 11, Java 17 and Java 21. Theoritically, the build should be a little slower but, in practice, i am not able to see any effects thanks to gradle being multithreaded.

Spotless error message is also better, instead of just saying that a file is not correctly formatted, it prints the diff between the file and the file once formatted.

Merge request reports