Closed mapoulin closed 3 years ago
👋 Have you seen https://github.com/snyk/snyk-gradle-plugin/issues/130? Could you try the suggestions from there?
@mapoulin did the suggestion resolve your issue?
Possibly, for now we are refraining from upgrading shadow and remain on the 5.2.0 version.
@mapoulin are you able at all to share a link to a project that uses the plugin or provide an example that shows the problem so we can look into this further to understand how to work with shadow 5.2.0?
@lili2311, I've attempted to reproduce a sample that creates this issue, but have been unable to. The more that I observe this appears to be more related to #130 and that there is a component capability defined or introduced in the build. Also to clarify the OP stated that 5.2.0 works, but 6.0.0 breaks. I've also tried both sides of that puzzle with no errors reproduced.
This repo shows that shadow 6.0.0 as described above working successfully and not producing an error when running snyk test
:
https://github.com/shanman190/snyk-gradle-plugin-gh-134/tree/master (single module with shadow 6.0.0 plugin)
https://github.com/shanman190/snyk-gradle-plugin-gh-134/tree/multi (multi module with shadow 6.0.0 plugin)
@mapoulin, it would help if you could provide a reproducible example that we could work from. Thanks!
@shanman190 thanks for trying to reproduce.
I've played a bit with the repo you provided. Turns out it might have to do with the fact that my project is pulling on a Java 11 dependency. Using shadow@5.2.0 I have no issue with that dependency, but when I use shadow@6.0.0 I suddenly get the error above.
Snyk seems to be looking for a version compatible with Java 8.
I've tried to give a POC here: https://github.com/shanman190/snyk-gradle-plugin-gh-134/pull/1
Ahh! That makes more sense. That would mean component metadata produced by publishing would be being introduced. That then leads into your error here.
@mapoulin, just to double check, both the dependency and your project are compiling using Java 11, correct?
@mapoulin, it also seems like the 6.0.0 version actually has a bug (force sets Java 1.8 because there is no easy public way to get the compiler version) that would make it partially incompatible with your use case. The Gradle team is trying to come up with a better alternative, but you can see the issue here:
I think with that information, this definitely folds back into the same issue related to component metadata and the CLI flattening all configurations into a single one for dependency analysis.
@shanman190 Yes, both of my projects are configured to use Java 11.
I'm glad this could shed some light. Thanks for your time!
With this https://github.com/snyk/snyk-gradle-plugin/pull/155 we solved the issue, closing this one! ^^
node -v
: v14.5.0npm -v
: 6.14.7snyk -v
: 1.366.0gradle -v
: 6.5.1Command run:
snyk test
Expected behaviour
When running with
com.github.johnrengelman.shadow
plugin version 5.2.0✓ Tested 335 dependencies for known issues, no vulnerable paths found.
Actual behaviour
When running with
com.github.johnrengelman.shadow
plugin version 6.0.0Steps to reproduce
If applicable, please append the
--debug
flag on your command and include the output here **ensuring to remove any sensitive/personal details or tokens.