Skip to content

Commit

Permalink
Parse source files in expected project order
Browse files Browse the repository at this point in the history
Use the order by Maven reactor to parse the module source files.
  • Loading branch information
knutwannheden committed May 5, 2023
1 parent 66887b5 commit 7a7f2b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ protected ResultsContainer listResults() throws MojoExecutionException {
Map<MavenProject, List<Marker>> projectProvenances = mavenSession.getProjects().stream()
.collect(Collectors.toMap(Function.identity(), projectParser::generateProvenance));
Map<MavenProject, Xml.Document> projectMap = projectParser.parseMaven(mavenSession.getProjects(), projectProvenances, ctx);
for (Map.Entry<MavenProject, Xml.Document> entry : projectMap.entrySet()) {
List<Marker> projectProvenance = projectProvenances.get(entry.getKey());
sourceFiles.addAll(projectParser.listSourceFiles(entry.getKey(), entry.getValue(), projectProvenance, styles, ctx));
for (MavenProject mavenProject : mavenSession.getProjects()) {
List<Marker> projectProvenance = projectProvenances.get(mavenProject);
sourceFiles.addAll(projectParser.listSourceFiles(mavenProject, projectMap.get(mavenProject), projectProvenance, styles, ctx));
}
}

Expand Down

0 comments on commit 7a7f2b6

Please sign in to comment.