in src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java [1331:1364]
private Set<File> getCompileSources(Compiler compiler, CompilerConfiguration compilerConfiguration)
throws MojoExecutionException, CompilerException {
String inputFileEnding = compiler.getInputFileEnding(compilerConfiguration);
if (inputFileEnding == null || inputFileEnding.isEmpty()) {
// see MCOMPILER-199 GroovyEclipseCompiler doesn't set inputFileEnding
// so we can presume it's all files from the source directory
inputFileEnding = ".*";
}
SourceInclusionScanner scanner = getSourceInclusionScanner(inputFileEnding);
SourceMapping mapping = getSourceMapping(compilerConfiguration, compiler);
scanner.addSourceMapping(mapping);
Set<File> compileSources = new HashSet<>();
for (String sourceRoot : getCompileSourceRoots()) {
File rootFile = new File(sourceRoot);
if (!rootFile.isDirectory()
|| rootFile.getAbsoluteFile().equals(compilerConfiguration.getGeneratedSourcesDirectory())) {
continue;
}
try {
compileSources.addAll(scanner.getIncludedSources(rootFile, null));
} catch (InclusionScanException e) {
throw new MojoExecutionException(
"Error scanning source root: '" + sourceRoot + "' for stale files to recompile.", e);
}
}
return compileSources;
}