Use File.toURI().toURL() when adding dependencies to the classpath.
-------------------------------------------------------------------
Key: MEXEC-79
URL: http://jira.codehaus.org/browse/MEXEC-79
Project: Maven 2.x Exec Plugin
Issue Type: Bug
Components: java
Affects Versions: 1.1.1
Reporter: Luis Pureza
Priority: Minor
Attachments: call_toURI_to_properly_encode_urls.patch
exec:java adds project dependencies to the classpath using the File.toURL()
method. According to the documentation at
http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#toURL(), this method
won't escape illegal characters in URLs, such as spaces. This means that if the
dependency is within c:\Documents and Settings\.m2\repository..., it will be
appended as-is to the classpath.
This does not work when using the Jetty servlet container. When deploying a web
application it will try to iterate over all the URLs on the classpath and call
.toURI() on them (see
http://download.eclipse.org/jetty/7.0.1.v20091125/xref/org/eclipse/jetty/webapp/WebInfConfiguration.html#81).
This fails because the URLs contain spaces.
I'm not sure if this is Jetty's or MEXEC's fault, but calling
File.toURI().toURL() instead of just File.toURL() when adding the URL to the
classpath solves the problem. The attached patch does just that.
--
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 from this list, please visit:
http://xircles.codehaus.org/manage_email