Maven reactor builds in order that doesn't satisfy all dependencies

I installed all your projects with all versions set to 1.0 here. Then I changed the versions as you stated and got the same error.

After changing the reactor POM to:

 <modules>
    <module>jar1</module>
    <module>jar2</module>
    <module>jar3</module>
</modules>

... the build succeeded.

I looked at Guide to Working with Multiple Modules, Reactor Sorting and the last option there is:

  • the order declared in the <modules> element (if no other rule applies)

After reading the next sentence:

Note that only "instantiated" references are used - dependencyManagement and pluginManagement elements will not cause a change to the reactor sort order

  • I restored the reactor POM
  • I commented the <dependencyManagement> section in the parent POM and added <version> to the jar2 and jar3 POMs explicitly

and the build succeeded with:

[INFO] Reactor Build Order
[INFO]
[INFO] jar3
[INFO] jar1
[INFO] jar2
[INFO] reactor

Tags:

Maven

Maven 3