You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brett Porter (JIRA)" <ji...@codehaus.org> on 2007/05/24 12:08:58 UTC

[jira] Closed: (SUREFIRE-322) MalformedURLException on windows when useSystemClassLoader set to true

     [ http://jira.codehaus.org/browse/SUREFIRE-322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter closed SUREFIRE-322.
---------------------------------

      Assignee: Brett Porter
    Resolution: Fixed

applied an alternative solution

> MalformedURLException on windows when useSystemClassLoader set to true
> ----------------------------------------------------------------------
>
>                 Key: SUREFIRE-322
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-322
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: plugin
>    Affects Versions: 2.3
>         Environment: Windows XP (and probably all win32 OS)
>            Reporter: Mark Palmer
>            Assignee: Brett Porter
>             Fix For: 2.3.1
>
>         Attachments: SUREFIRE-322.patch
>
>
> useSystemClassLoader does not work on windows XP, due to the way that the surefire plugin creates a manifest.mf which includes all necessary jars to run the projects tests.
> The manifest.mf file created in surefirebooter[1-9]*.jar contains absolute paths that begin with the drive letter, e.g. c:\somedir\somejar.jar on
> on unix this would be /somedir/somejar.jar which java.net.URL can cope with, on windows c:/somedir/somejar.jar needs to be changed to file:///c:\somedir\somejar.jar
> steps to recreate are simple:
> 1. mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
> 2. add the following entry in pom.xml for my-app
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-surefire-plugin</artifactId>
> 				<configuration>
> 					<useSystemClassLoader>true</useSystemClassLoader>
> 				</configuration>
> 			</plugin>
> 		</plugins>
> 	</build>
> 3. mvn install
> which will fail with 
> [INFO] Building jar: c:\DOCUME~1\username\LOCALS~1\Temp\surefirebooter43635.jar
> java.net.MalformedURLException: unknown protocol: c
>         at java.net.URL.<init>(URL.java:573)
>         at java.net.URL.<init>(URL.java:463)
>         at sun.misc.URLClassPath$JarLoader.parseClassPath(URLClassPath.java:923)
>         at sun.misc.URLClassPath$JarLoader.getClassPath(URLClassPath.java:896)
>         at sun.misc.URLClassPath.getLoader(URLClassPath.java:351)
>         at sun.misc.URLClassPath.getResource(URLClassPath.java:205)
>         at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:846)
>         at java.security.AccessController.doPrivileged1(Native Method)
>         at java.security.AccessController.doPrivileged(AccessController.java:389)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:371)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:570)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:502)
> The java class is not found:  org/apache/maven/surefire/booter/SurefireBooter

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