in log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/LocationMojo.java [105:132]
public void execute() throws MojoExecutionException, MojoFailureException {
if ("pom".equals(project.getPackaging())) {
getLog().info("Skipping project with packaging \"pom\".");
return;
}
if (!validateLog4jVersion()) {
return;
}
final Path sourceDirectory = this.sourceDirectory.toPath();
final Path outputDirectory = this.outputDirectory.toPath();
final LocationCacheGenerator locationCache = new LocationCacheGenerator();
final LocationClassConverter converter = new LocationClassConverter(getProjectDependencies());
try {
final Set<Path> staleClassFiles =
getClassFileInclusionScanner().getIncludedClassFiles(sourceDirectory, outputDirectory);
staleClassFiles.stream()
.collect(Collectors.groupingBy(LocationCacheGenerator::getCacheClassFile))
.values()
.parallelStream()
.forEach(p -> convertClassfiles(p, converter, locationCache));
locationCache.generateClasses().forEach(this::saveClassFile);
} catch (WrappedIOException e) {
throw new MojoExecutionException("An I/O error occurred.", e.getCause());
}
}