Try with
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.2</version>
<configuration>
<forkMode>never</forkMode>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.1.3</version>
</plugin>
This two configurations saved me.
Probably related to http://jira.codehaus.org/browse/MSUREFIRE-109 (not
sure).
I have some trouble with spring resources (that's why I use
<forkMode>never</forkMode> with 2.2)
HTH,
-Olivier
-----Message d'origine-----
De : Wim Deblauwe [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 18 mai 2006 10:13
À : Maven Users List
Objet : Repost: [m2] surefire classloading issue
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 <[email protected]>
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
This e-mail, any attachments and the information contained therein ("this
message") are confidential and intended solely for the use of the addressee(s).
If you have received this message in error please send it back to the sender
and delete it. Unauthorized publication, use, dissemination or disclosure of
this message, either in whole or in part is strictly prohibited.
**********************************************************************
Ce message électronique et tous les fichiers joints ainsi que les informations
contenues dans ce message ( ci après "le message" ), sont confidentiels et
destinés exclusivement à l'usage de la personne à laquelle ils sont adressés.
Si vous avez reçu ce message par erreur, merci de le renvoyer à son émetteur
et de le détruire. Toutes diffusion, publication, totale ou partielle ou
divulgation sous quelque forme que se soit non expressément autorisées de ce
message, sont interdites.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]