Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-3043

Allow 'mvn test' to work with test-jar dependencies in a reactor

    Details

    • Number of attachments :
      1

      Description

      Basically the issue is demonstrated by MNG-2045, but instead of running 'mvn install', you run 'mvn test'.

      Test classes of dependencies should be resolved from the reactor, just as main classes, if there's no archive available.

      I'm not sure how to go about this. Specifying a dependency on something with <type>test-jar</type>,
      and having that dependency declare the maven-jar-plugin with the 'test-jar' goal is insufficient.
      Perhaps we can just add a standard classifier that maven is aware of, in this case 'tests'. The jar packaging
      would export this as a known classifier, and tells maven how it contributes to what classpath.

      Since test sources are a first class citizen, just as main sources are (they have the same phases, same
      elements in the pom (but differently named)).

      It seems logical to me that somehow the test classes should be made available to dependencies,
      if they declare a dependency with classifier 'tests'.

        Issue Links

          Activity

          Hide
          Basil James Whitehouse III added a comment -

          This also seems to affect the Release plugin when performing a release:prepare.

          Show
          Basil James Whitehouse III added a comment - This also seems to affect the Release plugin when performing a release:prepare.
          Hide
          Piotr Tabor added a comment -

          I am nearly sure that this issue is reason for this bug.
          Patch provided 2 months ago.

          Show
          Piotr Tabor added a comment - I am nearly sure that this issue is reason for this bug. Patch provided 2 months ago.
          Hide
          Piotr Tabor added a comment -

          Kenney, could you check if your problem is resolved with current (SVN/SNAPSHOT) version of maven-jar-plugin.
          I hope MJAR-75 that was fixed, resolved this issue too.

          Thank you

          Show
          Piotr Tabor added a comment - Kenney, could you check if your problem is resolved with current (SVN/SNAPSHOT) version of maven-jar-plugin. I hope MJAR-75 that was fixed, resolved this issue too. Thank you
          Hide
          Benjamin Bentmann added a comment -

          Sample project.

          Show
          Benjamin Bentmann added a comment - Sample project.
          Hide
          Benjamin Bentmann added a comment -

          Feature branch has been created for discussion on dev@.

          Show
          Benjamin Bentmann added a comment - Feature branch has been created for discussion on dev@ .
          Hide
          Benjamin Bentmann added a comment -

          Done in r798494.

          Show
          Benjamin Bentmann added a comment - Done in r798494 .
          Hide
          Benjamin Bentmann added a comment -

          Need to revise to address MNG-4269.

          Show
          Benjamin Bentmann added a comment - Need to revise to address MNG-4269 .
          Hide
          Benjamin Bentmann added a comment -

          Revised in r800294.

          Show
          Benjamin Bentmann added a comment - Revised in r800294 .

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Kenney Westerhof
            • Votes:
              8 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: