Skip to content

Commit 9dff6cd

Browse files
committed
Merge pull request #44340 from nosan
* pr/44340: Don't use ArgFile when using JavaCompiler Closes gh-44340
2 parents 9ba851d + 0e81b63 commit 9dff6cd

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected final void compileSourceFiles(URL[] classPath, File sourcesDirectory,
147147
JavaCompilerPluginConfiguration compilerConfiguration = new JavaCompilerPluginConfiguration(this.project);
148148
List<String> options = new ArrayList<>();
149149
options.add("-cp");
150-
options.add(ClasspathBuilder.forURLs(classPath).build().argument());
150+
options.add(ClasspathBuilder.forURLs(classPath).build().toString());
151151
options.add("-d");
152152
options.add(outputDirectory.toPath().toAbsolutePath().toString());
153153
String releaseVersion = compilerConfiguration.getReleaseVersion();

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ private void addClasspath(List<String> args) throws MojoExecutionException {
348348
try {
349349
Classpath classpath = ClasspathBuilder.forURLs(getClassPathUrls()).build();
350350
if (getLog().isDebugEnabled()) {
351-
getLog().debug("Classpath for forked process: "
352-
+ classpath.elements().map(Object::toString).collect(Collectors.joining(File.separator)));
351+
getLog().debug("Classpath for forked process: " + classpath);
353352
}
354353
args.add("-cp");
355354
args.add(classpath.argument());

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ClasspathBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ Stream<Path> elements() {
186186
return this.elements.stream();
187187
}
188188

189+
@Override
190+
public String toString() {
191+
return elements().map(Path::toString).collect(Collectors.joining(File.pathSeparator));
192+
}
193+
189194
}
190195

191196
}

0 commit comments

Comments
 (0)