Skip to content

Don't use ArgFile when using JavaCompiler #44340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected final void compileSourceFiles(URL[] classPath, File sourcesDirectory,
JavaCompilerPluginConfiguration compilerConfiguration = new JavaCompilerPluginConfiguration(this.project);
List<String> options = new ArrayList<>();
options.add("-cp");
options.add(ClasspathBuilder.forURLs(classPath).build().argument());
options.add(ClasspathBuilder.forURLs(classPath).build().toString());
options.add("-d");
options.add(outputDirectory.toPath().toAbsolutePath().toString());
String releaseVersion = compilerConfiguration.getReleaseVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ private void addClasspath(List<String> args) throws MojoExecutionException {
try {
Classpath classpath = ClasspathBuilder.forURLs(getClassPathUrls()).build();
if (getLog().isDebugEnabled()) {
getLog().debug("Classpath for forked process: "
+ classpath.elements().map(Object::toString).collect(Collectors.joining(File.separator)));
getLog().debug("Classpath for forked process: " + classpath);
}
args.add("-cp");
args.add(classpath.argument());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ Stream<Path> elements() {
return this.elements.stream();
}

@Override
public String toString() {
return elements().map(Path::toString).collect(Collectors.joining(File.pathSeparator));
}

}

}