Declare Maven dependency as test runtime only
There is no scope that does exactly what you want here; test is the best available option. A test-runtime scope has been requested before (Re: Need for a test-runtime scope?) and the suggested workaround is exactly the ignoreNonCompile configuration you’ve already discovered. dependency:analyze already has some limitations (“some cases are not detected (constants, annotations with … Read more