This message was deleted.
# community-support
s
This message was deleted.
j
I think I had the same issue some weeks ago. 😄 This is usually a timing problem, where Gradle does not report the error well. Have you tested locally with a completely clean state? You might see the same error then. I have often seen this ,where it supposedly works locally, but it actually takes old versions of the Jars (from the previous build run) as input to the transform. The root of the problem is dependency resolution that is triggered too early. There is only a particular window between the "main" configuration time and before any task starts in which transforms should/can run. But Gradle does not check that well and you get unexpected/inconsistent errors. I think the shadow plugin has a "bug" here. IIRC, I did some debugging, and saw that this "resolve()" is triggered during configuration time: https://github.com/johnrengelman/shadow/blob/main/src/main/groovy/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.java#L48 The
resolvedConfiguration
access here is the problematic part I believe: https://github.com/johnrengelman/shadow/blob/main/src/main/groovy/com/github/jenge[…]/gradle/plugins/shadow/internal/AbstractDependencyFilter.groovy That should not be done and instead the filtering implemented there should be done lazily at a later point. It breaks transforms. I did not follow up, as I somehow did not required a solution in my case (but I don't remember why right now...) The best solution would be a patch for the Shadow plugin.
f
💡 Thanks for the elaborate response! Yeah that makes a bit more sense. Indeed a
clean shadowJar
also reproduces the issue locally. I was running
shadowJar --rerun-tasks
before, but looks like this does not affect artifact transforms.
j
I think the issue in Gradle is that the real error (the transform starts too early) is not detected. (Not sure if there is a GH issue for that already, but there probably should be.) If there is a Jar file to pick up, the transform (re)runs without error. "--rerun-task" does not remove any files. Only "clean" does that.
f