diff --git a/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java b/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java index 4abe7e44..db570121 100644 --- a/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java +++ b/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java @@ -274,9 +274,9 @@ protected ResultsContainer listResults() throws MojoExecutionException { Map> projectProvenances = mavenSession.getProjects().stream() .collect(Collectors.toMap(Function.identity(), projectParser::generateProvenance)); Map projectMap = projectParser.parseMaven(mavenSession.getProjects(), projectProvenances, ctx); - for (Map.Entry entry : projectMap.entrySet()) { - List projectProvenance = projectProvenances.get(entry.getKey()); - sourceFiles.addAll(projectParser.listSourceFiles(entry.getKey(), entry.getValue(), projectProvenance, styles, ctx)); + for (MavenProject mavenProject : mavenSession.getProjects()) { + List projectProvenance = projectProvenances.get(mavenProject); + sourceFiles.addAll(projectParser.listSourceFiles(mavenProject, projectMap.get(mavenProject), projectProvenance, styles, ctx)); } }