Are you running snyk test
using sudo
?
This could cause Snyk to load a different environment. This lists dependency as sudo mvn ...
, which in turn makes Maven use a different cache where the artifact may not be available.
Solutions
- Re-install snyk so that it does not need root access privileges.
- Use a snyk binary instead (https://github.com/snyk/snyk/releases) and run it as a local user.
Solution 1 is cleaner but solution 2 is faster.