Skip to content

Parameters that can affect your build

Björn Ekryd edited this page Mar 28, 2021 · 6 revisions

The parameters that can affect your build

All these parameters are turned off by default. So only turn them on if you know what you are doing.

The parameter sortDependencies can affect compilation

Maven reads dependencies according to the order in the pom-file when compiling. Rearranging that order may affect the compilation output.

The parameter sortPlugins and sortExecutions can affect compilation

If two plugins executes in the same phase, the order in pom-file will determine which plugin to execute first. Sorting the plugins may cause the compilation to fail if the result of one plugin is dependent on another. Sorting the actual executions (in the same phase) for a single plugin can also affect the build.

If you have replaced an ant-script with the antrun plugin tasks, you know what I mean.

The parameter sortModules can affect compilation

The compiling order of the modules (from Maven documentation) are based on:

  1. Project dependency on another module in the build
  2. Plugin declaration where the plugin is another modules in the build
  3. Plugin dependency on another module in the build
  4. Build extension declaration on another module in the build
  5. The order declared in the element (if no other rule applies)

This means that if you reorder the module section alphabetically, the compile order can be changed. If you then have an implicit dependency between modules, e.g. using the assembly plugin, the build result can be affected.