Fix install command on Windows

Windows absolute paths cannot be processed by the CLI compiler, so the install
command wasn't working on Windows. This change converts ths path to a URI first
and then it works as a Spring Resource.
This commit is contained in:
Dave Syer
2014-10-13 13:57:13 +01:00
parent 7211571969
commit f9010c18cc

View File

@@ -140,6 +140,7 @@ public class InstallCommand extends OptionParsingCommand {
for (URL url : urlsToProcess) {
File file = toFile(url);
Log.info("Processing: " + file);
if (file.getName().endsWith(".jar")) {
processor.processFile(file);
}
@@ -181,7 +182,8 @@ public class InstallCommand extends OptionParsingCommand {
finally {
stream.close();
}
return file.getAbsolutePath();
// Windows paths get tricky unless you work with URI
return file.getAbsoluteFile().toURI().toString();
}
private static File getDefaultLibDirectory() {