Anybody any thoughts on this? If nobody can help me, I will file this as a bug in JIRA if that is ok.
regards, Wim ---------- Forwarded message ---------- From: Wim Deblauwe <[EMAIL PROTECTED]> Date: 16-mei-2006 13:43 Subject: [m2] surefire classloading issue To: Maven Users List <users@maven.apache.org> Hi, I'm using Maven 1, trying to migrate. We are using Betwixt and some of our unit tests fail when run using surefire, but run fine in IntelliJ or Maven 1. Betwixt looks for descriptors with the name of the class + .betwixt to control how something is written out in XML. It uses the construct: myClass.getResource() to find the .betwixt file. E.g. com.mycomp.MyClass -> com/mycomp/MyClass.betwixt We have a betwixt file for the java.util.Date class. However, betwixt seems to be unable to pick it up when using surefire. I have created a small test that shows the problem. import junit.framework.TestCase; import java.util.Date; import java.net.URL; public class CLTest extends TestCase { public void testClassloading() { ClassLoader classLoader = getClass().getClassLoader(); System.out.println( "classLoader: " + classLoader ); URL resource = getClass().getResource( "/java/util/Date.betwixt" ); System.out.println( "resource: " + resource ); ClassLoader dateClassLoader = Date.class.getClassLoader(); System.out.println( "dateClassLoader: " + dateClassLoader ); URL dateResource = Date.class.getResource( "/java/util/Date.betwixt" ); System.out.println( "dateResource: " + dateResource ); } } When running this class through IntelliJ, the output is: classLoader: [EMAIL PROTECTED] resource: file:/C:/javatests/surefire-test/target/classes/java/util/Date.betwixt dateClassLoader: null dateResource: file:/C:/javatests/surefire-test/target/classes/java/util/Date.betwixt However, when using surefire, I get: classLoader: [EMAIL PROTECTED] resource: file:/C:/javatests/surefire-test/target/classes/java/util/Date.betwixt dateClassLoader: null dateResource: null any ideas? regards, Wim