Skip to content

Commit f9010c1

Browse files
committed
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.
1 parent 7211571 commit f9010c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-boot-cli/src/main/java/org/springframework/boot/cli/command/install/InstallCommand.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ private void processJars(List<URL> urlsToProcess) throws IOException {
140140

141141
for (URL url : urlsToProcess) {
142142
File file = toFile(url);
143+
Log.info("Processing: " + file);
143144
if (file.getName().endsWith(".jar")) {
144145
processor.processFile(file);
145146
}
@@ -181,7 +182,8 @@ private String createSources(List<String> args) throws IOException {
181182
finally {
182183
stream.close();
183184
}
184-
return file.getAbsolutePath();
185+
// Windows paths get tricky unless you work with URI
186+
return file.getAbsoluteFile().toURI().toString();
185187
}
186188

187189
private static File getDefaultLibDirectory() {

0 commit comments

Comments
 (0)