Skip to content

Allow Java Format without Spotless - #1755

Open
FinlayRJW wants to merge 1 commit into
developfrom
finlayw/java-format-without-spotless
Open

Allow Java Format without Spotless#1755
FinlayRJW wants to merge 1 commit into
developfrom
finlayw/java-format-without-spotless

Conversation

@FinlayRJW

Copy link
Copy Markdown
Contributor

Before this PR

Applying the Java Format Gradle plugin without Spotless on the buildscript classpath fails on Gradle 9. PalantirJavaFormatSpotlessPlugin eagerly creates SpotlessInterop, so Gradle resolves its FormatterStep dependency even when no Spotless plugin is applied.

After this PR

SpotlessInterop is created only after both Java and Spotless are applied. Projects can use Java Format without putting Spotless on the buildscript classpath.

==COMMIT_MSG==
==COMMIT_MSG==

Testing

A regression test verifies that PalantirJavaFormatSpotlessPlugin can be applied when Spotless is absent. The existing Spotless compatibility matrix, Error Prone, formatting, and Checkstyle checks pass. Three affected Gradle 9.7 builds also configure successfully with the locally published fix.

Possible downsides?

None known. Spotless integration is initialised at the same point that it is used: after a supported Spotless plugin is applied.

Are Docs needed?

No. This restores the existing optional integration behaviour.

@changelog-app

changelog-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Allow Java Format without Spotless

Check the box to generate changelog(s)

  • Generate changelog entry

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.

1 participant