Skip to content

Commit

Permalink
[FIXED #33] allow config to not fail the build on violations
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefarinacci committed Oct 3, 2017
1 parent cf5c5ff commit f18cfaf
Showing 1 changed file with 17 additions and 2 deletions.
Expand Up @@ -160,6 +160,13 @@ public void setSignature( String signatureId ) {
@Parameter( defaultValue = "false", property = "animal.sniffer.skip" )
protected boolean skip;

/**
* Should signature check failures throw an error?
*
*/
@Parameter( defaultValue = "true", property = "animal.sniffer.failOnError" )
protected boolean failOnError;

/**
*/
@Component
Expand Down Expand Up @@ -262,8 +269,16 @@ public void execute()

if ( signatureChecker.isSignatureBroken() )
{
throw new MojoFailureException(
"Signature errors found. Verify them and ignore them with the proper annotation if needed." );
if (failOnError)
{
throw new MojoFailureException(
"Signature errors found. Verify them and ignore them with the proper annotation if needed." );
}
else
{
getLog().info(
"Signature errors found. Verify them and ignore them with the proper annotation if needed." );
}
}
}
catch ( IOException e )
Expand Down

0 comments on commit f18cfaf

Please sign in to comment.