Red Hat Bugzilla – Bug 1007498
xmvn: adds scope test dependencies to requires in certain cases
Last modified: 2013-09-13 07:28:51 EDT
Description of problem:
For latest build of google-guice, XMvn produced automatic requires on <scope>test</scope> dependency that cannot be satisified.
Note that this is likely related to the fact that extensions have scope test dependency on artifact which is resolved by reactor.
Same problem in plexus-compiler 2.3
The problematic package (guice-extensions) is a POM-only package.
Test dependencies are expected to be included in this case.
Test dependencies are removed from effective POM during build because tests are skipped (%mvn_build -f). However auto-requires are generated from raw POM, which still contains test dependency. I think that this is expected -- if a package that directly or transitively requires this parent POM (i.e. some offspring POM) then this test dependency should be installed as we assume that tests are enabled by default and this offspring POM needs this dependency to build with tests enabled.
If there is a bogus auto-requires then most likely invalid dependencies should be removed from POM before building the package. If this POM is not needed by any other package (like in case of google-guice-extensions) then installation of that POM can be skipped (%mvn_packafe [...] __noinstall).
I don't consider this as a bug in XMvn unless you can show me a different case with unexpected requires.
The same commentary applies to org.codehaus.plexus:plexus-compilers - it's a POM, which is needed only by its offspring modules during build. Test dependency is expected in this case.
OK, closing as notabug. We'll just need to be extra carefult about pom-only packages