Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to ignore frontend execution error (non-zero exit code) #851

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ public abstract class AbstractFrontendMojo extends AbstractMojo {
@Parameter(property = "maven.test.failure.ignore", defaultValue = "false")
protected boolean testFailureIgnore;

/**
* Set this to true to ignore a failure during any execution task. Its use is NOT RECOMMENDED, but quite convenient on
* occasion.
*
* @since 1.8.1
*/
@Parameter(property = "maven.frontend.ignore.errors", defaultValue = "false")
protected boolean ignoreErrors;

/**
* The base directory for running all Node commands. (Usually the directory that contains package.json)
*/
Expand Down Expand Up @@ -96,6 +105,8 @@ public void execute() throws MojoFailureException {
} catch (TaskRunnerException e) {
if (testFailureIgnore && isTestingPhase()) {
getLog().error("There are test failures.\nFailed to run task: " + e.getMessage(), e);
} else if (ignoreErrors) {
getLog().info("There are ignored errors during task: " + e.getMessage());
} else {
throw new MojoFailureException("Failed to run task", e);
}
Expand Down