> -----Original Message-----
> From: Dan Fabulich [mailto:[EMAIL PROTECTED]
> Sent: 15 February 2008 22:52
> To: Maven Users List
> Subject: Re: Surefire 2.4.1 classpath order
>
> Ben Lidgey wrote:
>
> > We are running tests using Surefire 2.4.1 and Maven 2.0.8.
> [...]
>
[snip]
>
> I'm not 100% certain you're using the software you think
> you're using; here's some debugging/analysis tips.
>

Thanks for the tips. I've gone through the steps below.

> Take a look at http://jira.codehaus.org/browse/MNG-3118.
> That bug was fixed in Maven 2.0.8 and called out in the
> release announcement as a backwards compatibility risk:
>
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg00432.html
>
> As noted in MNG-3118, Surefire 2.3 had a bizarre classpath
> ordering bug that made the test classpath appear to be
> correct (test-classes first) under Maven 2.0.7 for some users
> with large classpaths:
>
> http://jira.codehaus.org/browse/SUREFIRE-61
>
> SUREFIRE-61 was fixed in Surefire 2.3.1.  Notably, it would
> make the "Test Classpath" output in -X look correct, while
> secretly under the hood it would munge the classpath incorrectly!

Doing "mvn help:effective-pom" showed

        <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <childDelegation>true</childDelegation>
          <systemProperties>
            <property>
              <name>log4j.configuration</name>
              <value>log4j.xml</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>

> As a result, for at least one project here at my work, we've seen:
>
> Maven 2.0.7 + Surefire 2.3: test-classes before classes Maven
> 2.0.8 + Surefire 2.3: classes before test-classes Maven 2.0.7
> + Surefire 2.3.1 or higher: classes before test-classes Maven
> 2.0.8 + Surefire 2.3.1 or higher: test-classes before classes

And "mvn --version" shows

$ mvn --version
Maven version: 2.0.8
Java version: 1.5.0_14
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

> Finally, note that your "real" classpath is being output in
> your target/surefire-reports/*.xml files as the
> "surefire.test.classpath"
> property; that may be useful for debugging purposes.

The surefire-reports/*.xm files showed

<property value="
C:\Documents and Settings\benl\.m2\repository\junit\junit\4.2\junit-4.2.jar;
[more jars]
c:\Development\Projects\Inuk\Inuk\ResidentialFramework\BroadbandGateway\target\classes;
c:\Development\Projects\Inuk\Inuk\ResidentialFramework\BroadbandGateway\target\test-classes;"
 name="surefire.test.class.path"/>

With target/classes before targe/test-classes.

So, to summarise:

Maven 2.0.8, Surefire 2.4.1, target/classes before target/test-classes

This is reinforced as the test is failing because the src/main/resources 
properties file does not have an entry whereas the src/test/resources 
properties file does, and the test fails as it cannot find that entry 
(therefore is looking at the one from src/main/resources).

Ben


This e-mail is confidential and intended solely for the use of the 
individual(s) to whom it is addressed. Any views or opinions expressed are 
those of the author. If you are not the intended recipient, please be advised 
that any use, dissemination, printing or copying of this email is strictly 
prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to