Merge branch '3.5.x' into 4.0.x

Closes gh-50089
This commit is contained in:
Andy Wilkinson
2026-04-16 11:25:34 +01:00
4 changed files with 37 additions and 20 deletions
@@ -16,6 +16,7 @@
package org.springframework.boot.cli.command.init;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
@@ -243,7 +244,7 @@ class InitializrService {
value = value.substring(start + FILENAME_HEADER_PREFIX.length());
int end = value.indexOf('\"');
if (end != -1) {
return value.substring(0, end);
return new File(value.substring(0, end)).getName();
}
}
}
@@ -137,7 +137,7 @@ class ProjectGenerator {
}
private void writeProject(ProjectGenerationResponse entity, String output, boolean overwrite) throws IOException {
File outputFile = new File(output);
File outputFile = new File(System.getProperty("user.dir"), output);
if (outputFile.exists()) {
if (!overwrite) {
throw new ReportableException(