rewrite-maven-plugin icon indicating copy to clipboard operation
rewrite-maven-plugin copied to clipboard

Order of parsed Maven modules is sometimes not correct

Open fabapp2 opened this issue 2 years ago • 6 comments

What version of OpenRewrite are you using?

I am using

  • OpenRewrite v8.5.1
  • Maven plugin v5.2.6

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 avatar Jul 18 '23 10:07 fabapp2

I fixed the link to the test, @timtebeek.

fabapp2 avatar Oct 19 '23 15:10 fabapp2

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

  • https://github.com/openrewrite/rewrite-maven-plugin/pull/720

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

  • https://github.com/openrewrite/rewrite-maven-plugin/pull/601

timtebeek avatar Jan 23 '24 09:01 timtebeek

@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.

timtebeek avatar Jan 23 '24 09:01 timtebeek

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

philippe-granet avatar Jan 23 '24 13:01 philippe-granet

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

timtebeek avatar Jan 24 '24 12:01 timtebeek

@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?

fabapp2 avatar May 07 '24 07:05 fabapp2