Build order of Maven multimodule project?

The build order is determined by the Maven reactor which is a mechanism that automatically ensures correct build order for multimodule builds by sorting the projects.

See the official documentation for how it works.

It says:

The following relationships are honoured when sorting projects:

  • a project dependency on another module in the build
  • a plugin declaration where the plugin is another modules in the build
  • a plugin dependency on another module in the build
  • a build extension declaration on another module in the build
  • the order declared in the element (if no other rule applies)

You can’t manually control the build order. If you want to change the order you have to make changes to your project that influence the reactor sort order.

Leave a Comment