Maven
  1. Maven
  2. MNG-2365

classes before test-classes in MavenProject.getTestClasspathElements() - should be the other way around?

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.4
    • Fix Version/s: None
    • Component/s: Reactor and workspace
    • Labels:
      None
    • Environment:
      doesnt matter

      Description

      in getTestClasspathElements() we have:

      List list = new ArrayList( getArtifacts().size() + 1 );
      list.add( getBuild().getOutputDirectory() );
      list.add( getBuild().getTestOutputDirectory() );

      • causing classes to be prior to test-classes in the classpath- something then prohibits test-resources/classes to shadow classes/ resources fom main. .I.e. it is not possible to redefine resources/classes for usage when running tests.

      Sugested solution:
      List list = new ArrayList( getArtifacts().size() + 1 );
      list.add( getBuild().getTestOutputDirectory() );
      list.add( getBuild().getOutputDirectory() );

      add test-classes before classes

      1. MNG-3118-test.patch
        1 kB
        Benjamin Bentmann

        Issue Links

          Activity

          Kai Lilleby created issue -
          John Casey made changes -
          Field Original Value New Value
          Fix Version/s 2.0.5 [ 12294 ]
          Hide
          Brett Porter added a comment -

          while this makes sense to me, ISTR having to change this in the past. Please investigate SVN history before doing this.

          Show
          Brett Porter added a comment - while this makes sense to me, ISTR having to change this in the past. Please investigate SVN history before doing this.
          kenneyw made changes -
          Fix Version/s 2.0.6 [ 13010 ]
          Fix Version/s 2.0.5 [ 12294 ]
          Jason van Zyl made changes -
          Fix Version/s 2.0.x [ 13141 ]
          Fix Version/s 2.0.6 [ 13010 ]
          Brett Porter made changes -
          Component/s Reactor and workspace [ 11938 ]
          Benjamin Bentmann made changes -
          Link This issue duplicates MNG-3118 [ MNG-3118 ]
          Hide
          Benjamin Bentmann added a comment -

          This patch includes a unit test to to check the proper test class path ordering.

          Show
          Benjamin Bentmann added a comment - This patch includes a unit test to to check the proper test class path ordering.
          Benjamin Bentmann made changes -
          Attachment MNG-3118-test.patch [ 30662 ]
          Hide
          John Casey added a comment -

          applied the unit test, and all tests out just fine.

          Show
          John Casey added a comment - applied the unit test, and all tests out just fine.
          John Casey made changes -
          Resolution Cannot Reproduce [ 5 ]
          Assignee John Casey [ jdcasey ]
          Fix Version/s 2.2.0 [ 15103 ]
          Fix Version/s 2.2.x [ 13141 ]
          Status Open [ 1 ] Closed [ 6 ]
          Benjamin Bentmann made changes -
          Resolution Cannot Reproduce [ 5 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Benjamin Bentmann made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Duplicate [ 3 ]
          Fix Version/s 2.2.0 [ 15103 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
          Mark Thomas made changes -
          Workflow jira [ 12712990 ] Default workflow, editable Closed status [ 12752826 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
          Mark Thomas made changes -
          Workflow jira [ 12949983 ] Default workflow, editable Closed status [ 12986176 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          1050d 7h 42m 1 John Casey 29/Apr/09 18:42
          Closed Closed Reopened Reopened
          22h 33m 1 Benjamin Bentmann 30/Apr/09 17:15
          Reopened Reopened Closed Closed
          12s 1 Benjamin Bentmann 30/Apr/09 17:15

            People

            • Assignee:
              John Casey
              Reporter:
              Kai Lilleby
            • Votes:
              12 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development