desruisseaux commented on code in PR #1127:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1127#discussion_r4023079584


##########
src/main/java/org/apache/maven/plugin/compiler/ToolExecutor.java:
##########
@@ -463,6 +456,17 @@ protected Deque<Path> dependencies(PathType pathType) {
      * @param fileManager the file manager where to set the dependency paths
      */
     private void setDependencyPaths(final StandardJavaFileManager fileManager) 
throws IOException {
+        if (!hasModuleDeclaration) {
+            /*
+             * Unlike modular compilation, javac does not search the output 
directory automatically.
+             * Include classes produced by earlier compilers, even when all 
Java sources are rebuilt
+             * or the project has no dependencies. Do this after incremental 
dependency checks.
+             */
+            Collection<Path> paths = dependencies(JavaPathType.CLASSES);
+            if (!paths.contains(outputDirectory)) {
+                paths.add(outputDirectory);
+            }
+        }

Review Comment:
   Do not add this block if the suggestion to not remove the block below is 
applied.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to