nebula-release-plugin
nebula-release-plugin copied to clipboard
Using a relative git root breaks in java 1.14
If gralde.properties contains git.root=.. and the jvm running gradle then Grgit calculates the relative directory against the gradle daemon's working directory not the project. This doesn't happen when running java 1.8. If you run
./gradlew devSnapshot
in the child project of https://github.com/shysteph/nebula-release-plugin-bug on java 1.14 it will fail.
It will work on 1.8 or if a hack is applied by
./gradlew devSnapshot -Prelease.workCorrectly=true
It appears that user.dir
was never intended to be modified on either the command line or at runtime, so they cache the original working directory for use when resolving files:
- https://bugs.openjdk.java.net/browse/JDK-8194154
- https://github.com/openjdk/jdk/commit/4ea684bf31fc4e3cdee2ae51c0000a7b3e914151
It appears Gradle gets away with this for cases other than file system resolves by actually changing the process working directory:
- https://github.com/gradle/gradle/blob/master/subprojects/native/src/main/java/org/gradle/internal/nativeintegration/processenvironment/AbstractProcessEnvironment.java#L79-L83
- https://github.com/gradle/gradle/blob/master/subprojects/native/src/main/java/org/gradle/internal/nativeintegration/processenvironment/NativePlatformBackedProcessEnvironment.java#L41
But this will affect all uses of relative File
or Path
so I'll create a bug report on https://github.com/gradle/gradle/ so they're aware.
I added a comment to the pull request - the path should be resolved relative to the rootProject
directory.
Created https://github.com/gradle/gradle/issues/15380