Skip to content

Commit 96736c7

Browse files
Merge pull request #4 from Cousjava/failonerror
Plugin returns failure status if an error occurs
2 parents 89cd552 + 03ea112 commit 96736c7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/glassfish/build/ExecMojo.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 Payara Services Ltd.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -69,6 +70,12 @@ public final class ExecMojo extends AbstractMojo {
6970
@Parameter(property = "commandlineArgs")
7071
private String commandlineArgs;
7172

73+
/**
74+
* Plugin should return failure if an error occurred.
75+
*/
76+
@Parameter(property = "failOnError", defaultValue = "true")
77+
private Boolean failOnError;
78+
7279
@Override
7380
public void execute() throws MojoExecutionException, MojoFailureException {
7481

@@ -94,6 +101,7 @@ && new File(executable + ".bat").exists()) {
94101
exec.setExecutable(executable);
95102
getLog().info("executable: " + executable);
96103
exec.createArg().setLine(commandlineArgs);
104+
exec.setFailonerror(failOnError);
97105
getLog().info("commandLineArgs: " + commandlineArgs);
98106
exec.execute();
99107
}

0 commit comments

Comments
 (0)