openrewrite / rewrite-maven-plugin

OpenRewrite's Maven plugin.
https://openrewrite.github.io/rewrite-maven-plugin/plugin-info.html
Apache License 2.0
127 stars 67 forks source link

Order of parsed Maven modules is sometimes not correct #600

Open fabapp2 opened 11 months ago

fabapp2 commented 11 months ago

What version of OpenRewrite are you using?

I am using

What is the smallest, simplest way to reproduce the problem?

This test

should fail because module-a/pom.xml should be parsed last as it depends on module-b/pom.xml

It parses this project

and the Maven build order is:

image

Whereas the order of parsing is multi-module-1, module-a, module-b

Are you interested in [contributing a fix to OpenRewrite]

I will provide a PR.

fabapp2 commented 8 months ago

I fixed the link to the test, @timtebeek.

timtebeek commented 5 months ago

This one is starting to make more sense after seeing the work done in

I don't think the work there will have fixed this issue too, but it does help me understand and validate the work you've done in

timtebeek commented 5 months ago

@philippe-granet did you ever come across the problem outlined in this issue and the attached pull request #601 ? Seems like something that could have affected you too, especially when running in parallel, so wondering if you have any insight there.

philippe-granet commented 5 months ago

What could be the impacts if the poms are loaded out of order?

timtebeek commented 5 months ago

I'm not sure what exact problem Fabian had; do you recall @fabapp2?

fabapp2 commented 2 months ago

@timtebeek Sorry, I lost sight of this issue. IIRC the "problem" surfaced in tests when the expected order of poms did not match their build order calculated by Maven. I can't recall if this was actually a problem but I'd assume the order of build files to be critical to work correctly?