in src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java [1259:1286]
private void createMissingPackageInfoClasses(
CompilerConfiguration compilerConfiguration, SourceMapping sourceMapping, Set<File> sources)
throws InclusionScanException, IOException {
for (File source : sources) {
String path = source.toString();
if (path.endsWith(File.separator + "package-info.java")) {
for (String root : getCompileSourceRoots()) {
root = root + File.separator;
if (path.startsWith(root)) {
String rel = path.substring(root.length());
Set<File> files = sourceMapping.getTargetFiles(getOutputDirectory(), rel);
for (File file : files) {
if (!file.exists()) {
File parentFile = file.getParentFile();
if (!parentFile.exists()) {
Files.createDirectories(parentFile.toPath());
}
byte[] bytes = generatePackage(compilerConfiguration, rel);
Files.write(file.toPath(), bytes);
}
}
}
}
}
}
}