wilx commented on code in PR #1075:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1075#discussion_r3665432943


##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -1559,8 +1559,25 @@ private Set<File> computeStaleSources(
             }
 
             try {
-                staleSources.addAll(scanner.getIncludedSources(rootFile, 
outputDirectory));
-            } catch (InclusionScanException e) {
+                Set<File> includedSources = 
scanner.getIncludedSources(rootFile, outputDirectory);
+                // The stale source scanner assumes that every source produces 
an output file. Filter its result only
+                // when the compiler provides an individual source-to-output 
mapping; aggregate outputs are ambiguous.
+                if (outputStyle == 
CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE) {
+                    for (File source : includedSources) {
+                        String relativePath =
+                                
rootFile.toPath().relativize(source.toPath()).toString();
+                        boolean outputExists = 
mapping.getTargetFiles(outputDirectory, relativePath).stream()

Review Comment:
   The string is passed to the getTargetFiles method which uses it to construct 
`File` instance. OS specific separators are appropriate. 



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