Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-110

classesDirectory set in pom.xml is ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 2.0 (2.2 plugin)
    • None
    • None
    • None
    • Maven 2.0.4, Windows XP, jdk1.5.0_06

    Description

      The configuration of classesDirectory in the surefire configuration in the pom is ignored. This bug is new in 2.2, everything worked fine with surefire 2.1.3.

      Snippet from pom:
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.2</version>
      <inherited>true</inherited>
      <configuration>
      <forkMode>once</forkMode>
      <reportFormat>xml</reportFormat>
      <classesDirectory>${project.build.directory}/emma-classes</classesDirectory>
      <printSummary>false</printSummary>
      </configuration>
      </plugin>

      Debug output:

      First, with surefire 2.1.3:

      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.1.3:test' -->
      [DEBUG] (f) basedir = c:\example\server
      [DEBUG] (f) childDelegation = true
      [DEBUG] (f) classesDirectory = c:\example\server\target\emma-classes
      [DEBUG] (f) classpathElements = [c:\example\server\target\classes, c:\example\server\target\test-classes, C:\WINDOWS\Profiles\butenuth\.m2\repository\emma\emma\2.0.5312\emma-2.0.5312.jar, C:\WINDOWS\Profiles\butenuth\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar, C:\WINDOWS\Profiles\butenuth\.m2\repository\de\sdm\calculator\interface\1.0-SNAPSHOT\interface-1.0-SNAPSHOT.jar]
      [DEBUG] (f) forkMode = once
      [DEBUG] (f) jvm = java
      [DEBUG] (f) localRepository = [local] -> file://C:\WINDOWS\Profiles\butenuth\.m2\repository
      [DEBUG] (f) pluginArtifacts = [junit:junit:jar:3.8.1:runtime, org.apache.maven.surefire:surefire:jar:1.5.3:runtime, org.apache.maven.surefire:surefire-booter:jar:1.5.3:runtime, org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime, org.apache.maven:maven-plugin-api:jar:2.0:runtime, org.apache.maven:maven-artifact:jar:2.0:runtime]
      [DEBUG] (f) printSummary = false
      [DEBUG] (f) reportFormat = xml
      [DEBUG] (f) reportsDirectory = c:\example\server\target/surefire-reports
      [DEBUG] (f) testClassesDirectory = c:\example\server\target\test-classes
      [DEBUG] (f) testFailureIgnore = true
      [DEBUG] (f) useFile = true
      [DEBUG] – end configuration –
      [INFO] [surefire:test]
      [INFO] Setting reports dir: c:\example\server\target/surefire-reports
      [DEBUG] Test Classpath :
      [DEBUG] c:\example\server\target\test-classes
      [DEBUG] c:\example\server\target\emma-classes <----- my classes before default classes
      [DEBUG] c:\example\server\target\classes <----- is it correct they are still in classpath?
      [DEBUG] c:\example\server\target\test-classes

      Next, with surefire 2.2, classesDirectory is completely ignored:

      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.2:test' -->
      [DEBUG] (f) basedir = c:\example\server
      [DEBUG] (f) childDelegation = false
      [DEBUG] (f) classesDirectory = c:\example\server\target\emma-classes
      [DEBUG] (f) classpathElements = [c:\example\server\target\classes, c:\example\server\target\test-classes, C:\WINDOWS\Profiles\butenuth\.m2\repository\emma\emma\2.0.5312\emma-2.0.5312.jar, C:\WINDOWS\Profiles\butenuth\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar, C:\WINDOWS\Profiles\butenuth\.m2\repository\de\sdm\calculator\interface\1.0-SNAPSHOT\interface-1.0-SNAPSHOT.jar]
      [DEBUG] (f) disableXmlReport = false
      [DEBUG] (f) forkMode = once
      [DEBUG] (f) jvm = java
      [DEBUG] (f) localRepository = [local] -> file://C:\WINDOWS\Profiles\butenuth\.m2\repository
      [DEBUG] (f) parallel = false
      [DEBUG] (f) pluginArtifactMap =

      {org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:1.1:runtime, org.apache.maven.surefire:surefire-api=org.apache.maven.surefire:surefire-api:jar:2.0:runtime, org.apache.maven:maven-artifact=org.apache.maven:maven-artifact:jar:2.0:runtime, org.apache.maven:maven-plugin-api=org.apache.maven:maven-plugin-api:jar:2.0:runtime, org.apache.maven.surefire:surefire-booter=org.apache.maven.surefire:surefire-booter:jar:2.0:runtime}

      [DEBUG] (f) printSummary = false
      [DEBUG] (f) projectArtifactMap =

      {de.sdm.calculator:interface=de.sdm.calculator:interface:jar:1.0-SNAPSHOT:compile, emma:emma=emma:emma:jar:2.0.5312:test, junit:junit=junit:junit:jar:3.8.1:test}

      [DEBUG] (f) remoteRepositories = [[central] -> http://dussalsaseu1.dus.sdm.de:5003/maven-proxy/repository]
      [DEBUG] (f) reportFormat = xml
      [DEBUG] (f) reportsDirectory = c:\example\server\target\surefire-reports
      [DEBUG] (f) testClassesDirectory = c:\example\server\target\test-classes
      [DEBUG] (f) testFailureIgnore = true
      [DEBUG] (f) testSourceDirectory = c:\example\server\src\test\java
      [DEBUG] (f) threadCount = 5
      [DEBUG] (f) trimStackTrace = true
      [DEBUG] (f) useFile = true
      [DEBUG] – end configuration –
      [INFO] [surefire:test]
      [DEBUG] dummy:dummy:jar:1.0 (selected for null)
      ...
      [DEBUG] Test Classpath :
      [DEBUG] c:\example\server\target\classes
      [DEBUG] c:\example\server\target\test-classes
      [DEBUG] C:\WINDOWS\Profiles\butenuth\.m2\repository\emma\emma\2.0.5312\emma-2.0.5312.jar
      [DEBUG] C:\WINDOWS\Profiles\butenuth\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar
      [DEBUG] C:\WINDOWS\Profiles\butenuth\.m2\repository\de\sdm\calculator\interface\1.0-SNAPSHOT\interface-1.0-SNAPSHOT.jar
      [DEBUG] Setting system property [localRepository]=[C:\WINDOWS\Profiles\butenuth\.m2\repository]
      [DEBUG] Setting system property [basedir]=[c:\example\server]

      Attachments

        1. maven-surefire-plugin-trunk-410868.patch
          2 kB
          Andreas Rudolf
        2. surefire-booter-trunk-410867.patch
          3 kB
          Andreas Rudolf

        Issue Links

          Activity

            People

              brett Brett Porter
              butenuth Roger Butenuth
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: