Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 2.0.9, 2.1.0-M1
-
Fix Version/s: None
-
Component/s: Bootstrap & Build, Class Loading, Dependencies, Inheritance and Interpolation
-
Labels:None
-
Environment:MacOSX, Linux
-
Complexity:Intermediate
-
Testcase included:yes
-
Number of attachments :
Description
I have a module layout like this:
root -+- first
+- second
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:
<dependency>
<groupId>me</groupId>
<artifactId>first</artifactId>
<classifier>tests</classifier>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
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:
/.../root/second/src/main/java/me/SecondMain.java:[3,10] cannot find symbol symbol : class FirstTest location: package me
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.
Issue Links
- duplicates
-
MNG-2720
Multiproject dependencies not accurate for project.compileClasspathElements when run from root project
-
See integration test for
MNG-2720. It actually reproduces this exact use case.http://svn.apache.org/repos/asf/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2720