Test jar dependency not available for for main classes in multi module builds -----------------------------------------------------------------------------
Key: MNG-4032 URL: http://jira.codehaus.org/browse/MNG-4032 Project: Maven 2 Issue Type: Bug Components: Bootstrap & Build, Class Loading, Dependencies, Inheritance and Interpolation Affects Versions: 2.1.0-M1, 2.0.9 Environment: MacOSX, Linux Reporter: Henrik Brautaset Aronsen Attachments: tests-dependency.zip I have a module layout like this: {noformat} root -+- first +- second {noformat} I have the test-jar plugin enabled, thus a *-tests.jar is built for each module. In the second module, I have defined a dependency to first's tests jar: {noformat} <dependency> <groupId>me</groupId> <artifactId>first</artifactId> <classifier>tests</classifier> <version>1.0-SNAPSHOT</version> <scope>compile</scope> </dependency> {noformat} And here's the problem: A class in the second main folder imports a class from the first test folder. If I build the second module separately it builds like it should. But if I build both modules from the root module I get a compilation failure: {noformat} /.../root/second/src/main/java/me/SecondMain.java:[3,10] cannot find symbol symbol : class FirstTest location: package me {noformat} A class in second's test folder also includes me.FirstTest, and it always compiles. The scope somehow seems to be overridden when doing multi module builds. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira