Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.9, 2.1.0-M1
-
None
-
None
-
MacOSX, Linux
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.
Attachments
Attachments
Issue Links
- duplicates
-
MNG-2720 Multiproject dependencies not accurate for project.compileClasspathElements when run from root project
- Closed
- is related to
-
MNG-2045 Maven can't compile against sibling test-jar dependency in multiproject (Test Attached)
- Closed
-
MNG-3043 Allow 'mvn test' to work with test-jar dependencies in a reactor
- Closed
-
MNG-4248 CLONE -Maven can't compile against sibling test-jar dependency in multiproject (Test Attached)
- Closed