Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GrEclipseFormatterStep fails when ~/.m2/ is not writable #1797

Closed
DanielThomas opened this issue Aug 31, 2023 · 1 comment
Closed

GrEclipseFormatterStep fails when ~/.m2/ is not writable #1797

DanielThomas opened this issue Aug 31, 2023 · 1 comment

Comments

@DanielThomas
Copy link

DanielThomas commented Aug 31, 2023

In our CI environment, the build user cannot write to their own home directory, but we configure ~/.m2/settings.xml to change the local repository a separate mount for builds:

  <localRepository>/agent/.m2/repository</localRepository>

However the configuration of P2Model here doesn't reflect that setting, and tries to write to the read-only location:

Caused by: java.nio.file.AccessDeniedException: /home/<user>/.m2/repository	
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)	
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)	
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)	
	at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)	
	at java.nio.file.Files.createDirectory(Files.java:700)	
	at java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)	
	at java.nio.file.Files.createDirectories(Files.java:793)	
	at dev.equo.solstice.p2.FileMisc.lambda$mkdirs$2(FileMisc.java:84)	
	at dev.equo.solstice.p2.FileMisc.retry(FileMisc.java:101)	
	at dev.equo.solstice.p2.FileMisc.retry(FileMisc.java:93)	
	at dev.equo.solstice.p2.FileMisc.mkdirs(FileMisc.java:84)	
	at dev.equo.solstice.p2.QueryCacheOnDisk.<init>(QueryCacheOnDisk.java:33)	
	at dev.equo.solstice.p2.P2Model.query(P2Model.java:118)	
	at com.diffplug.spotless.extra.EquoBasedStepBuilder.get(EquoBasedStepBuilder.java:107)	
	at com.diffplug.spotless.FormatterStepImpl.calculateState(FormatterStepImpl.java:58)	
	at com.diffplug.spotless.LazyForwardingEquality.state(LazyForwardingEquality.java:56)	
	at com.diffplug.spotless.LazyForwardingEquality.unlazy(LazyForwardingEquality.java:118)	
	at com.diffplug.spotless.LazyForwardingEquality.unlazy(LazyForwardingEquality.java:124)	
	at com.diffplug.gradle.spotless.JvmLocalCache$LiveCacheKeyImpl.set(JvmLocalCache.java:60)	
	at com.diffplug.gradle.spotless.SpotlessTask.setSteps(SpotlessTask.java:168)	
	at com.diffplug.gradle.spotless.SpotlessTaskImpl_Decorated.setSteps(Unknown Source)	
	at com.diffplug.gradle.spotless.FormatExtension.setupTask(FormatExtension.java:927)	
	at com.diffplug.gradle.spotless.GroovyGradleExtension.setupTask(GroovyGradleExtension.java:56)	
	at com.diffplug.gradle.spotless.SpotlessExtensionImpl.lambda$createFormatTasks$6(SpotlessExtensionImpl.java:70)

Appears that was introduced here:

2673e91

Seen when upgrading from Spotless 6.9.1 to 6.20.0 w/ Gradle.

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

No branches or pull requests

2 participants