« Return to Thread: Surefire 2.4.1 classpath order

RE: Surefire 2.4.1 classpath order

by dfabulich :: Rate this Message:

Reply to Author | View in Thread

Ben Lidgey wrote:

> <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.

This is the reverse order from what it's supposed to be.  Not only are
test-classes supposed to appear before classes, but both of those are
supposed to appear before your dependency jars.

Looks like we'll need to try some more debugging. :-)

1) If you run mvn -X you'll see lots of useful debugging information,
including the command line we used to launch Surefire.  It looks something
like this:

   Forking command line: cmd.exe /X /C '"C:\jdk1.5.0_12\jre\bin\java -jar
     C:\DOCUME~1\dan\LOCALS~1\Temp\surefirebooter61534.jar
     C:\DOCUME~1\dan\LOCALS~1\Temp\surefire61532tmp
     C:\DOCUME~1\dan\LOCALS~1\Temp\surefire61533tmp"'

You may notice that none of your jars appear on this list; that's by
design.  Go take a look at the jar file and you'll see that it's a
"manifest-only" jar; it contains only a META-INF/MANIFEST.MF file,
specifying a Main-Class and a Class-Path to run the code.  Make sure that
the manifest looks correct and that the jars/dirs appear in the correct
order.

2) Try pulling down our "classpath-order" test project here:

http://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-integration-tests/src/test/resources/classpath-order
http://tinyurl.com/3csqca

Run "mvn test" and confirm that you see the same thing I do in
classpath-order/target/surefire-reports/TEST-it.BasicTest.xml. I get
test-classes first, classes second, and then a whole bunch of jars.  If
the classpath order is incorrect, the test should fail.

Hopefully, classpath-order will pass on your machine.  If that's the case,
then the next thing to do will be to investigate what's different between
your Inuk projects and our classpath-order test.

If classpath-order doesn't work on your machine, then I'll be surprised;
I'm not exactly certain how to investigate that.  You could try filing a
bug in that case and attaching debugging information for the
classpath-order test.  To debug, we'd want: -X logs, a copy of your
surefirebooter#####.jar, and the two surefire#####tmp files that are
passed in as arguments.

Good luck!

-Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: Surefire 2.4.1 classpath order