Maven fail strategies

Maven allows to customise how it handles failures when it executes a goal (ie: compiling code, executing tests, etc). This in particularly important on multi module projects where the result of the goal in a module could affect the desired behaviour on dependant ones.

The default strategy is fail fast (-ff or --fail-fast: Stop at first failure in reactorized builds), maven stops execution at the first error.

Then comes fail at end (-fae or --fail-at-end: Only fail the build afterwards; allow all non-impacted builds to continue), maven proceeds executing on the other modules, but skipping modules depending on the one that has failed.

Then comes fail never (-fn or --fail-never: NEVER fail the build, regardless of project result), maven ignores failures and keeps executing on all remaining modules, even modules that depend on the failing one.

See also:
Mastering The Maven Command Line – Managing failures

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s