public void execute()

in log4j-transform-maven-plugin/src/main/java/org/apache/logging/log4j/transform/maven/LocationMojo.java [102:127]


    public void execute() throws MojoExecutionException, MojoFailureException {
        if ("pom".equals(project.getPackaging())) {
            getLog().info("Skipping project with packaging \"pom\".");
            return;
        }
        validateLog4jVersion();

        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());
        }
    }