[
http://jira.codehaus.org/browse/MGROOVY-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_105664
]
Jason Dillon commented on MGROOVY-64:
-------------------------------------
Um, well that still doesn't work. I can't tell where to problem is really
either... well the root of the problem that is. I have been able to get around
this by hacking up the Classworlds {{RealmClassLoader}} with:
{code}
/**
* Encodes any spaces in the given URL with <tt>%20</tt>.
*/
private URL encodeURL(final URL url) {
if (url == null) {
return null;
}
String s = url.toString();
// If no spaces, then return quicker w/o more object creation overhead below
if (s.indexOf(' ') < 0) {
return url;
}
// Start with a reasonable size for one ' ' -> "%20"
StringBuffer buff = new StringBuffer(s.length() + 2);
// current and position
int c = 0, p;
// Replace all ' ' with "%20"
while (c < s.length()) {
p = s.indexOf(' ', c);
if (p < 0) {
break;
}
buff.append(s.substring(c, p)).append("%20");
c = p + 1;
}
buff.append(s.substring(c));
// Rebuild the URL
try {
return new URL(buff.toString());
}
catch (MalformedURLException e) {
// This shouldn't happen really
throw new Error(e);
}
}
public URL findResource(String name) {
return encodeURL(super.findResource(name));
}
public URL getResource(String name) {
return encodeURL(getRealm().getResource(name));
}
public URL getResourceDirect(String name) {
return encodeURL(super.getResource(name));
}
{code}
This basically forces all spaces to be encoded as {{%20}} whenever a resource
is asked for... Using this hack in my local environment does fix the problem.
I'm still not sure if the bug is in Classworlds, Ant, Groovy, Maven, Groovy
Maven Plugin or the JDK.
I'm trying to figure out a way to hack in the above translation to the Groovy
Maven Plugin w/o needing to get a new version of Classworlds released as well
as Maven to get this working though...
But as of yet I've not figured out an easy way to hijack the class loader which
is getting picked up...
<soapbox>
Ugh... I fricken *hate* windows so much. Why on earth did they think it was a
good idea to put spaces in the default directory names? Like {{c:\programs}},
{{c:\documents}} and {{c:\settings}} wasn't good enough? Or really why didn't
they put user's home directories into {{c:\home}} or {{c:\users}}.
I really hope that eventually the world will wise up and drop this crap
operation system into the toilet like the stinking rotting pile of crap that it
is.
</soapbox>
> Invalid dependency path on Windows
> ----------------------------------
>
> Key: MGROOVY-64
> URL: http://jira.codehaus.org/browse/MGROOVY-64
> Project: Maven 2.x Groovy Integration
> Issue Type: Bug
> Components: execute
> Affects Versions: 1.0-beta-1
> Environment: Windows XP
> Reporter: Mauro Talevi
> Assignee: Jason Dillon
> Priority: Blocker
> Fix For: 1.0-beta-3
>
>
> On Windows XP - use of AntBuilder in the groovy script is not possible as the
> path to the Ant dependency contains illegal characters.
> Caused by: java.net.URISyntaxException: Illegal character in path at index
> 18:
> file:/C:/Documents and
> Settings/<username>/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
> Presumably the spaces in the "Documents and Settings".
> The problem does not manifest itself in 1.0-alpha-3.
--
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