Skip to content

Which version of "googleJavaFormat" to use? #1316

@Lokowandtg

Description

@Lokowandtg

Currently we are using spotless-maven-plugin:2.44.4 together with googleJavaFormat 1.19.1 to format the java sources. This does not work in JDK8 but all later versions.
With JDK25, spotless-maven-plugin:3.0.0 and googleJavaFormat 1.27.0 are the minimal versions. Older versions will simply fail when ./mvnw spotless:check is executed.
This version does require JDK17 or higher.
I see three options to continue:
a) Stick with 2.44.4 and 1.19.1 and do not run spotless in JDK25 and later.
b) Upgrade to 3.00 and 1.27.0 and do not run spotless in JDK16 and earlier.
c) Choose the spotless version depending on the JDK version.

a) Is least effort for existing developers, but makes onboarding for new contributors more complicated.
b) Is least effort for new developers, might be a problem if someone is required to use a JDK before 17.
c) At the moment, the differences in the formatters (mostly indenting in comments) have no impact on existing code. That might change with added documentation in the future, resulting in formatters changing back and forth.

My prefered solution is b). Are there any showstoppers?
Alternatively we could go for c) until we have see a problem and switch to b) then.

What are your thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions