updated exception handling

This commit is contained in:
Jeremy Long
2017-07-21 06:53:54 -04:00
parent 60b8bde19a
commit af9bc9ec3e

View File

@@ -86,6 +86,14 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
exCol.getExceptions().addAll(ex.getExceptions());
if (ex.isFatal()) {
exCol.setFatal(true);
final String msg = String.format("Fatal exception(s) analyzing %s", childProject.getName());
if (this.isFailOnError()) {
throw new MojoExecutionException(msg, exCol);
}
getLog().error(msg);
if (getLog().isDebugEnabled()) {
getLog().debug(exCol);
}
}
}
}