Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4655

'mvn test' tries to locate tests jar of other module in repository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.2.1
    • None
    • None

    Description

      Normally when running 'compile' or 'test' phases, Maven uses the path to the build directory ('target/classes') of modules in the dependency list.

      However, if the dependency list contains a dependency with classifier 'tests' (that was created with test-jar goal of the jar plugin), then it is searched in the local repository.

      I imagine the issue is because the dependency is on something that is created in the package stage and therefore doesn't exist in the 'test' phase. However, I think there should be a way to get to target/test-classes (similarly to getting target/classes in compile)

      Note: In my case extracting the dependency test code to a separate module is not an option since the module has tests that rely on it and it relies on the core code of the module, creating a cyclic dependency.

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              ittayd Ittay Dror
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: