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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.4
    • None
    • Reactor and Workspace
    • None
    • 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

      Attachments

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

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              kai@systemfabrikken.no Kai Lilleby
              Votes:
              12 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: