Surefire fails to start when the local repository and the project (pom.xml) 
lives in different window drives
------------------------------------------------------------------------------------------------------------

         Key: MSUREFIRE-43
         URL: http://jira.codehaus.org/browse/MSUREFIRE-43
     Project: Maven 2.x Surefire Plugin
        Type: Bug

    Versions: 2.1.2    
 Environment: Windows XP
Java 1.5.0_06
Maven 2.0.1
Surefire fork mode: once
    Reporter: Martin Desruisseaux


We have the following situation:

- Local repository in {{C:\Documents and Settings\user\.m2}}
- A Maven 2 project in {{P:\MyProject}}.
- Surefire fork mode set to "once".

In this configuration, surefire fails with this (somewhat misleading) error 
message:

{quote}
    Setting reports dir: {{P:\MyProject\target/surefire-reports}}
    BUILD ERROR
    There are some test failure.
{quote}

This message is misleading because it suggests that some user's tests failed, 
while actually Surefile didn't executed a single one. It even failed before to 
create the {{surefire-reports}} directory! So we have no indication about the 
cause, and printing the stack trace with the {{-e}} option doesn't help much (I 
suspect that this is because the stack trace was actually produced by a 
different virtual machine instance, and was not passed to the JVM running 
Maven). Running Maven with the {{-X}} option provides more hints however. We 
can see that Maven try to executes the following command:

{{java -Xmx512M -enableassertions -classpath 
"C:\...snip...\.m2\repository\org\apache\maven\surefire\surefire-booter\1.5.2\surefire-booter-1.5.2.jar;
 C:\Java\Apache\Maven2\bin\..\core\plexus-utils-1.0.5.jar" 
org.apache.maven.surefire.SurefireBooter P:\MyProject}}

Running this command manually gives the following output:

{code}
ClassLoader: typeclass sun.misc.Launcher$ExtClassLoader, value=...snip...
           : file:/C:/Java/1.5/jre/lib/ext/sunjce_provider.jar
           : file:/C:/Java/1.5/jre/lib/ext/sunpkcs11.jar
           (...snip...)
ClassLoader: typeclass sun.misc.Launcher$AppClassLoader, value=...snip...
           : file:/C:/Documents ...snip... /.m2/repository/ ...snip.. 
./surefire-booter-1.5.2.jar
           : file:/C:/Java/Apache/Maven2/core/plexus-utils-1.0.5.jar
ClassLoader: typeclass org.apache.maven.surefire.IsolatedClassLoader, 
value=...snip...
           : file:/P:/MyProjects/
           (...snip...)
           : file:/P:/Documents and 
Settings/user/.m2/repository/...snip.../surefire-1.5.2.jar
Exception in thread "main" java.lang.ClassNotFoundException: 
org.apache.maven.surefire.Surefire
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
           (...snip...)
{code}

As you can see, the path for {{surefire-1.5.2.jar}} wrongly refer to the drive 
letter {{P:}}. It should be {{C:}} instead.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to