GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow setting the local P2 cache dir in the Spotless Gradle plugin by bric3 · Pull Request #2944 · diffplug/spotless

Conversation

@bric3

@bric3 bric3 commented May 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This adds a way to control in which directory the Eclipse based formatters will be cached. This PR adds a cacheDirectory method in the config of each Eclipse based steps.

The reason is that, by default the eclipse resolver will place the downloaded artifacts in ~/.m2/repository/dev/equo/p2-data, this folder is a bit alien in Gradle based build. And having it nested in the maven repository structure makes it a bit harder to manage in a CI.

Given it's a Gradle related change, I choose to not add this under the maven plugin since .m2/ is already maven managed.

  • a summary of the change
  • either
    • a link to the issue you are resolving (for small changes)
    • a link to the PR you just created (for big changes likely to have discussion)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jochenberger reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@bric3
feat: Allow setting the local P2 cache dir in the Spotless Gradle plugin
f436d5f
bric3
bric3 commented May 21, 2026
View reviewed changes
Comment thread plugin-gradle/CHANGES.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bric3
chore: Adds the pull number
c1f2421
@jochenberger

jochenberger commented May 21, 2026

Copy link
Copy Markdown
Contributor

Maybe the Gradle plug-in could also set a more sensible default?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jochenberger

jochenberger commented May 21, 2026

Copy link
Copy Markdown
Contributor

Somewhere inside $GRADLE_USER_HOME for example?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bric3

bric3 commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

I hesitated to do that, as it's a breaking change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jochenberger

jochenberger commented May 22, 2026

Copy link
Copy Markdown
Contributor

IMHO, if we just break a potentially existing cache, it's not so much of an issue. But maybe you're right. 🤷🏼‍♂️

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bric3

bric3 commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

Actually I slept on it, and I kind of agree with you know, it could be considered a bug.

And as a matter of fact, under the hood spotless uses a "fake" eclipse, and there's a mechanism that is supposedly handling Gradle, but it only works if the GRADLE_USER_HOME env var is there. See

https://github.com/equodev/equo-ide/blob/731353e7046f7f7e73da7fd5524991168bccc045/solstice/src/main/java/dev/equo/solstice/p2/CacheLocations.java#L80-L104

I suppose there are various reasons why it's like that in solstice. But spotless knows where it is run so it should provide sensible defaults. I'm commiting someting in that regard.

jochenberger reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bric3
fix: use build-tool P2 cache directories
08f3829
Set Gradle's default P2 cache under Gradle user home and Maven's under
the local repository, while keeping explicit cacheDirectory overrides
for both plugins.

Solstice uses the maven m2 directory unless GRADLE_USER_HOME is set
https://github.com/equodev/equo-ide/blob/main/solstice/src/main/java/dev/equo/solstice/p2/CacheLocations.java#L80-L104
@nedtwigg

nedtwigg commented May 23, 2026

Copy link
Copy Markdown
Member

It's been a long time, but I recall the Solstice cache directory being changed because somebody felt strongly it was in the wrong place before. I think the point of ~/.m2 is that it makes it more likely that a CI runner with automatically cache it, instead of needed special setup just for Spotless deps to get cached.

I'm okay with changing it, but it needs to be clearly laid out in the changelog "Eclipse dependencies were cached at X by default, now they are cached at Y by default"

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jochenberger

jochenberger commented May 23, 2026

Copy link
Copy Markdown
Contributor

That might have been me actually. And I still think that ~/.m2 is not a very good default in the Gradle ecosystem.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bric3

bric3 commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

I think the point of ~/.m2 is that it makes it more likely that a CI runner with automatically cache it

Yeah, I think it totally makes sense on maven. But on gradle builds it doesn't.

It's a breaking change, but now that the cache directory is configurable, users can easily revert to the path they want. That said I understand you might want to postpone the change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented May 26, 2026

Copy link
Copy Markdown
Member

I'm okay with this change. If you are both happy with it (@bric3 and @jochenberger) then I'm happy to merge.

jochenberger reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jochenberger

jochenberger commented May 26, 2026

Copy link
Copy Markdown
Contributor

I love it. 🙂

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg
Merge branch 'main' into add-cache-directory-dsl
a266fc2
@bric3

bric3 commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

I'm ok for it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg
nedtwigg merged commit a074d53 into diffplug:main May 27, 2026
20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bric3
bric3 deleted the add-cache-directory-dsl branch May 27, 2026 13:56
@diukarev diukarev mentioned this pull request May 30, 2026
Fix #2950: tolerate null equality state in ConfigurationCacheHackList input fingerprinting #2951
Closed
This was referenced Aug 7, 2026
Improve Gradle configuration plume-lib/bcel-util#557
Merged
Harmonize Gradle setup plume-lib/lookup#515
Merged
@dduportal dduportal mentioned this pull request Nov 9, 2026
BOM build failing due to Eclipse infra issues jenkins-infra/helpdesk#5349
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bric3 @jochenberger @nedtwigg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.