Join compile classpath using system-dependent separator

See gh-30525
pull/31057/head
Andy Wilkinson 3 years ago
parent 6c01b341fa
commit 08768b5821

@ -155,8 +155,8 @@ public class AotGenerateMojo extends AbstractRunMojo {
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) { try (StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null)) {
List<String> options = List.of("-cp", List<String> options = List.of("-cp",
Arrays.stream(classpathUrls).map(URL::toString).collect(Collectors.joining(":")), "-d", Arrays.stream(classpathUrls).map(URL::toString).collect(Collectors.joining(File.pathSeparator)),
this.classesDirectory.toPath().toAbsolutePath().toString()); "-d", this.classesDirectory.toPath().toAbsolutePath().toString());
Iterable<? extends JavaFileObject> compilationUnits = fm.getJavaFileObjectsFromPaths(sourceFiles); Iterable<? extends JavaFileObject> compilationUnits = fm.getJavaFileObjectsFromPaths(sourceFiles);
Errors errors = new Errors(); Errors errors = new Errors();
CompilationTask task = compiler.getTask(null, fm, errors, options, null, compilationUnits); CompilationTask task = compiler.getTask(null, fm, errors, options, null, compilationUnits);

Loading…
Cancel
Save