[jboss-dev] Maven Multi-Module Test Gotcha

Jason T. Greene jason.greene at redhat.com
Tue Sep 29 17:31:15 EDT 2009


A few days ago I committed a test to a module in the jboss-deployers 
project that broke subclassed test cases in other sibling modules. 
However, when I ran the full jboss-deployers test suite, everything 
passed. Paul looked into it, and it turns out there is a maven bug [1] 
that causes modules to use the local repository (and alternatively the 
remote repo) over the test class path for dependencies on sibling 
modules. So unless you install everything first you will likely end up 
with the wrong classpath, and thus invalid results. Unfortunately the 
bug is only fixed in 3.x.

So, as a workaround, make sure you always do "mvn install; mvn test" on 
root projects when you have modules that share test classes.

[1] http://jira.codehaus.org/browse/MNG-3043

-- 
Jason T. Greene
JBoss, a division of Red Hat



More information about the jboss-development mailing list