When to use MojoExecutionException vs MojoFailureException in Maven

It seems you should throw a MojoExecutionException if the problem makes it impossible to continue with the build, and use the MojoFailureException otherwise.

You can control the behavior for handing MojoFailureExpections when maven is run.

The following link details the difference: https://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html#writing-plugins-sect-failure
Broken link? Google search
sonatype writing-plugins-sect-custom-plugin writing-plugins-sect-failure

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)