Open attiand opened 8 months ago
The problem appears to be with this line https://github.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.
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. :thinking:
Hi there, I'm facing this issue, and I was wondering 2 things:
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.
FYI - this issue is reproducible when running tests of spotless itself ./gradlew test
.
The directories are created under lib-extra
folder.
Running
./mvnw spotless:apply
with spotless setup to format Groovy a temporary directory is left in the root. See the following reproducer project: https://github.com/attiand/spotless-tmp-file-issueI would have no problem if the plugin left temporary directories in the Maven
target
directory, but it is annoying in the project root.The file was named like this:
file%3A%2Ftmp%2Fspotless-groovy10387858394287009044%2F