Maven
  1. Maven
  2. MNG-2045

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      WinXP

      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.

      1. it1021.tar.gz
        1 kB
        Carlos Sanchez
      2. mng-2045-ittest.zip
        10 kB
      3. MNG-2045-maven-project-r577340.patch1
        0.8 kB
        Paul Gier
      4. MNG-2045-maven-project-r577340.patch2
        1 kB
        Paul Gier
      5. release-log.zip
        150 kB
        Michael Osipov
      6. sample.zip
        23 kB
        Brian Fox

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Brian Fox
              Reporter:
              Brian E. Fox
            • Votes:
              11 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development