Skip to content

Commit 0e81b63

Browse files
nosanphilwebb
authored andcommitted
Don't use ArgFile when using JavaCompiler
See gh-44340 Signed-off-by: Dmytro Nosan <[email protected]>
1 parent 9ba851d commit 0e81b63

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

+1-1
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

+1-2
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

+5
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)