Maven 2 & 3

CLONE -Maven can't compile against sibling test-jar dependency in multiproject (Test Attached)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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 :
    0

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

Activity

Hide
Obi Ezechukwu added a comment -

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.

Show
Obi Ezechukwu added a comment - 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.
Hide
Benjamin Bentmann added a comment -

The example project from the original issue works with Maven 2.1.0 and this bug report doesn't give any new information that could be used to reproduce and ananlyze your issue.

Show
Benjamin Bentmann added a comment - The example project from the original issue works with Maven 2.1.0 and this bug report doesn't give any new information that could be used to reproduce and ananlyze your issue.

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: