diff --git a/src/main/java/sbt_inc/SbtIncrementalCompiler.java b/src/main/java/sbt_inc/SbtIncrementalCompiler.java index 49c5dcfc..158f3c7b 100644 --- a/src/main/java/sbt_inc/SbtIncrementalCompiler.java +++ b/src/main/java/sbt_inc/SbtIncrementalCompiler.java @@ -152,13 +152,10 @@ public void compile( Path classesDirectory, List scalacOptions, List javacOptions) { - List fullClasspath = new ArrayList<>(); - fullClasspath.add(classesDirectory); - fullClasspath.addAll(classpathElements); CompileOptions options = CompileOptions.of( - fullClasspath.stream() + classpathElements.stream() .map(PlainVirtualFile::new) .toArray(VirtualFile[]::new), // classpath sources.stream().map(PlainVirtualFile::new).toArray(VirtualFile[]::new), // sources diff --git a/src/main/java/scala_maven/ScalaCompileMojo.java b/src/main/java/scala_maven/ScalaCompileMojo.java index 41b8e83d..543e8c10 100644 --- a/src/main/java/scala_maven/ScalaCompileMojo.java +++ b/src/main/java/scala_maven/ScalaCompileMojo.java @@ -71,7 +71,6 @@ protected List getSourceDirectories() throws Exception { @Override protected Set getClasspathElements() throws Exception { final Set back = FileUtils.fromStrings(project.getCompileClasspathElements()); - back.remove(new File(project.getBuild().getOutputDirectory())); addAdditionalDependencies(back); if (classpath != null && classpath.getAdd() != null) { getLog().warn("using 'classpath' is deprecated, use 'additionalDependencies' instead"); diff --git a/src/main/java/scala_maven/ScalaCompilerSupport.java b/src/main/java/scala_maven/ScalaCompilerSupport.java index 5e9414fa..96234286 100644 --- a/src/main/java/scala_maven/ScalaCompilerSupport.java +++ b/src/main/java/scala_maven/ScalaCompilerSupport.java @@ -357,7 +357,6 @@ private int incrementalCompile( instance); } - classpathElements.remove(outputDir); List scalacOptions = getScalaOptions(); List javacOptions = getJavacOptions(); diff --git a/src/main/java/scala_maven/ScalaTestCompileMojo.java b/src/main/java/scala_maven/ScalaTestCompileMojo.java index c6bc266b..3cd8a11a 100644 --- a/src/main/java/scala_maven/ScalaTestCompileMojo.java +++ b/src/main/java/scala_maven/ScalaTestCompileMojo.java @@ -60,7 +60,6 @@ public void execute() throws MojoExecutionException, MojoFailureException { @Override protected Set getClasspathElements() throws Exception { Set back = FileUtils.fromStrings(project.getTestClasspathElements()); - back.remove(new File(project.getBuild().getTestOutputDirectory())); addAdditionalDependencies(back); return back; }