Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.3
-
Component/s: None
-
Labels:None
Description
In SurefireBooter.createClassLoader() the path is converted to a URL using
File f = new File( url );
urls.add( f.toURL() );
File.toURL does not perform URL encoding so the resulting URL may contain invalid characters. This is an issue on Windows machines where the default maven repository is in "C:\Documents and Settings\user\.m2\..." (the filename contains spaces). If a test accesses a resource that is loaded from a dependency jar then the URL returned to that test is malformed.
With JDK 1.4 this can be fixed using
urls.add( f.toURI().toURL() );
as toURI() does encode the path. If surefire still needs to run under pre-1.4 JVMs this would need to be explicitly encoded. I'm willing to supply a patch for that if wanted.
Issue Links
- is duplicated by
-
SUREFIRE-211
JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
-
- is related to
-
SUREFIRE-46
Proper escape of classpath entries esp. in windows
-
- relates to
-
SUREFIRE-46
Proper escape of classpath entries esp. in windows
-
- supercedes
-
SUREFIRE-46
Proper escape of classpath entries esp. in windows
-
we support back to JDK 1.3, so we would need the explicit encoding - thanks for volunteering!