Skip to content

Commit

Permalink
Merge 9cca4c7 into 484f489
Browse files Browse the repository at this point in the history
  • Loading branch information
bvedrenne committed Dec 21, 2021
2 parents 484f489 + 9cca4c7 commit cd76314
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ So your config would become something like :
<artifactId>arch-unit-maven-plugin</artifactId>
<version>2.7.2</version>
<configuration>

<!-- optional - you can avoid build fail if there is issue. True to avoid build failure, default is false -->
<noFailOnError>true</noFailOnError>

<!-- optional - you can exclude classes that have a path containing any of the mentioned paths -->
<excludedPaths>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class ArchUnitMojo extends AbstractMojo {
@Parameter(defaultValue = "${project.build.directory}")
private String projectBuildDir;

@Parameter(property = "noFailOnError", defaultValue = "false")
private boolean noFailOnError;

public MavenRules getRules() {
return rules;
}
Expand Down Expand Up @@ -96,7 +99,11 @@ public void execute() throws MojoFailureException {
}

if (!StringUtils.isEmpty(ruleFailureMessage)) {
throw new MojoFailureException(PREFIX_ARCH_VIOLATION_MESSAGE + ruleFailureMessage);
if(!noFailOnError) {
throw new MojoFailureException(PREFIX_ARCH_VIOLATION_MESSAGE + ruleFailureMessage);
}

getLog().info(PREFIX_ARCH_VIOLATION_MESSAGE + ruleFailureMessage);
}
}

Expand Down

0 comments on commit cd76314

Please sign in to comment.