Skip to content

Conversation

@kevinherron
Copy link
Collaborator

@kevinherron kevinherron commented Dec 30, 2025

What problem(s) was I solving?

The project lacked automated code formatting, which can lead to inconsistent code style across contributions and make code reviews more tedious due to style-related changes mixed with logical changes.

Additionally, the build was using JDK 11 in CI, but the Spotless Maven plugin (v3.0.0) requires JDK 17 to run.

What user-facing changes did I ship?

No user-facing changes. This is a developer tooling improvement.

How I implemented it

  1. Added Spotless Maven plugin with Google Java Format configuration to enforce consistent code formatting
  2. Configured Maven Toolchains plugin to use JDK 17 for the build while still targeting JDK 11 for compiled bytecode
  3. Updated GitHub Actions workflows to use JDK 17 (required for Spotless)
  4. Applied formatting to all existing Java source files using mvn spotless:apply

The build now:

  • Uses JDK 17 via toolchains (required for Spotless)
  • Compiles with --release 11 to ensure JDK 11 compatibility
  • Runs spotless:check during the build to enforce formatting

How to verify it

Manual Testing

  • mvn clean verify passes
  • Code formatting matches Google Java Format style

Description for the changelog

Add Spotless Maven plugin with Google Java Format for automated code formatting. Build now requires JDK 17 via toolchains while maintaining JDK 11 target compatibility.

- Update GitHub Actions workflows to use JDK 17
- Add maven-toolchains-plugin to use JDK 17 for build
- Add maven-compiler-plugin with release flag for JDK 11 target
- Add spotless-maven-plugin with Google Java Format
@kevinherron kevinherron merged commit 42fbd87 into master Dec 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants