cloudfoundry / cloudfoundry/cf-java-client

Which version of "googleJavaFormat" to use?

Open
#1,316 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
334
Forks
319
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current spotless-maven-plugin and googleJavaFormat setup, then run ./mvnw spotless:check with the relevant JDK versions. Done means choosing and documenting a supported version strategy, updating the configuration if needed, and confirming formatting checks work for the intended JDK range.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.