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

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development