I'm using maven-dependency-plugin:3.1.1:analyze-only
to control my dependencies. We have a corporate-wide parent POM that defines the possible dependencies in dependencyManagement
and there are dependencies in every Maven scope.
Also, I configured <outputXML>
to be true
on the plugin, because it's very handy to just copy/paste the missing dependencies from the plugin's report to the POM.
So, we have a util-foobar
project for general utility classes (scope compile
) and a util-baz-test
for utility classes that are only used for testing (scope test
).
Now, if I use a class from util-foobar
in my main source, everything's ok and the dependency analysis is correct. And the same goes for using util-baz-text
in my test source.
However, if I use a class from util-foobar
only in my test source, the plugin will show me the dependencies missing, due to <outputXML>
. And it will tell me that I need to add util-foobar
with scope compile
instead of scope test
. It looks like the plugin is only considering the scopes from dependency management and not looking at where in the source folders the class requiring util-foobar
is located.
Am I doing something wrong or is the plugin working as designed?