I\'m having trouble using test-jar dependencies in a multi-module project. For example, when I declare that the cleartk-syntax module depends on the
So I did some serious debugging, and discovered that the problem seems to be an interaction between the exec:java plugin, test-jar dependencies and mvn compile.
In short, if you attach exec:java to an execution phase, mvn compile starts looking for test-jar dependencies at compile time. If you remove the element from the exec:java plugin declaration, mvn compile works fine again.
I filed a bug report for the exec:java plugin here, though I can't really tell whether the bug is in exec:java, test-jar or mvn compile so perhaps the bug will be moved somewhere else if/when someone figures that out:
http://jira.codehaus.org/browse/MEXEC-91
Update: It's not really a bug, the maven-exec-plugin is documented as requiring test dependencies here:
http://mojo.codehaus.org/exec-maven-plugin/java-mojo.html
That doesn't mean it wouldn't make a great feature. ;-)