Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.1.0
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:WinXP
-
Complexity:Intermediate
-
Testcase included:yes
-
Number of attachments :
Description
I have 2 projects under a parent like so:
--Parent
— sample-jar
— sample-jar-user
sample-jar builds and installs a test-jar along with the normal jar. sample-jar-user depends on the test-jar at compile time. When I build from the parent folder, the build fails because it can't find the class. When I go to sample-jar-user and build, it works fine.
In the attached test case, to reproduce:
from the root folder, run mvn clean install - See it fail.
cd sample-jar-user; mvn clean install - see it succeed.
I remember reading somewhere that in multiprojects, maven attempts to locate the sibling classes in the source tree instead of using the jars from the repository. I'm guessing the problem is here that it's not looking in ../sample-jar/target/test-classes for this code, but really one should expect this to come from the repository.
Issue Links
| This issue relates to: | ||||
| MNG-4032 | Test jar dependency not available for for main classes in multi module builds |
|
|
|
| MNG-3043 | Allow 'mvn test' to work with test-jar dependencies in a reactor |
|
|
|
| MWAR-7 | Referenced projects' artifacts naming scheme behaves differently when ran from reactor |
|
|
|
| MNG-4056 | Relax resolution of active project artifacts from the reactor with regard to artifact type |
|
|
|
| This issue is related to: | ||||
| MNG-3559 | Multi-Module Project: module that depends on sibling test jar cannot execute test-compile without install of sibling first |
|
|
|
| MNG-2720 | Multiproject dependencies not accurate for project.compileClasspathElements when run from root project |
|
|
|
| MNG-2877 | unable to resolve attached artifacts from reactor that are not in repo. (patch applied in svn and IT tests added) |
|
|
|
| MNG-2871 | Subartifact (ejb-client, test-jar etc.) are not reselved as active project artifacts in build phases prior to package |
|
|
|
| This issue supercedes: | ||||
| MNG-2045 | Maven can't compile against sibling test-jar dependency in multiproject (Test Attached) |
|
|
|
| This issue depends upon: | ||||
| MJAR-75 | [PATCH] Wrong artifact type attached to the project by the test-jar goal |
|
|
|
I have attemted Joerg's suggestion, and I am afraid that I am experiencing the same problem with maven 2.1.0. So it does not appear that this issue has been fixed for multi-module projects.