Closed shoaniki closed 11 months ago
Gradle configuration cache is a rushed, ill-designed and half-baked feature that is incompatible with many of Gradle's own existing APIs. See https://github.com/gradle/gradle/issues/18520
Can you provide a reproducer? Which version of the plugin are you using? I pushed a test which passes.
This problem still exists. I am not 100% sure yet, but I assume that it is related to the project.zipTree
here:
While it should be okay to use zipTree
here I think, it might be an issue with how this is routed (is it Project.project
or Task.project
?) in dynamic Groovy. Maybe that's why it work sometimes (in the test) but not in all user scenarios. But that's only a guess, because I see nothing else in there that might cause this. Here is the report:
I don't know why the tests do not reproduce this, but all my manual testing indicate that it is a general problem: it is not possible to access project.zipTree
in this mapping context, which is (presumably) executed close to execution time. Which somehow makes sense, as the actual files are not always available during configuration time yet.
Maybe there is a simpler way to get the ArchiveOperations
service, but this is the "simplest" fix I could come up with: #261
Describe the bug The plugin causes an error if the experimental Gradle configuration cache is enabled.
To Reproduce Run
gradle jmh --configuration-cache
in a project that uses this plugin.The output will include an error along the lines of:
This appears to happen for both shadow and non-shadow forms of the jar task.
There's an easy and obvious workaround, of course -- "don't do that" -- but it becomes a chore if the configuration cache is turned on in gradle.properties.