You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2019/10/09 06:34:59 UTC
[sling-slingfeature-maven-plugin] branch master updated: SLING-8773
: Fail build if javadoc generation fails
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 015bf9b SLING-8773 : Fail build if javadoc generation fails
015bf9b is described below
commit 015bf9bca5b1505cfbe2a8c7a9f26edbc2d3e3c4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 9 08:34:52 2019 +0200
SLING-8773 : Fail build if javadoc generation fails
---
.../java/org/apache/sling/feature/maven/mojos/JavadocExecutor.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sling/feature/maven/mojos/JavadocExecutor.java b/src/main/java/org/apache/sling/feature/maven/mojos/JavadocExecutor.java
index 2acf84c..fcd6d9b 100644
--- a/src/main/java/org/apache/sling/feature/maven/mojos/JavadocExecutor.java
+++ b/src/main/java/org/apache/sling/feature/maven/mojos/JavadocExecutor.java
@@ -105,10 +105,12 @@ final class JavadocExecutor {
DefaultExecutor executor = new DefaultExecutor();
executor.setWorkingDirectory(workingDir);
- executor.setExitValues(new int[] { 1, 0, -1 });
try {
executor.getStreamHandler().setProcessInputStream(new LoggerOutputStream(logger));
- executor.execute(javadocCommand);
+ final int exitValue = executor.execute(javadocCommand);
+ if (executor.isFailure(exitValue)) {
+ throw new MojoExecutionException("Javadoc generation failed. See log for more details.");
+ }
} catch (IOException ioe) {
throw new MojoExecutionException("Javadoc tool cannot be invoked on that machine", ioe);
}