You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:15:38 UTC
[sling-maven-sling-plugin] 14/48: Fail project build if
installation fails
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-sling-plugin-2.0.2-incubator
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git
commit 8e820d3e61305aed45576950415ca6ef2a875765
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Mon Sep 24 08:38:09 2007 +0000
Fail project build if installation fails
git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/maven-sling-plugin@578708 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/maven/bundlesupport/AbstractBundleInstallMojo.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java b/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java
index 8f93351..53bf0f5 100644
--- a/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java
+++ b/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java
@@ -98,7 +98,7 @@ public abstract class AbstractBundleInstallMojo extends AbstractBundlePostMojo {
post(slingUrl, bundleFile);
}
- protected void post(String targetURL, File file) {
+ protected void post(String targetURL, File file) throws MojoExecutionException {
// append pseudo path after root URL to not get redirected for nothing
PostMethod filePost = new PostMethod(targetURL + "/install");
@@ -135,12 +135,8 @@ public abstract class AbstractBundleInstallMojo extends AbstractBundlePostMojo {
getLog().error(
"Installation failed, cause: " + HttpStatus.getStatusText(status));
}
- } catch (ConnectException ce) {
- getLog().info("Installation on " + targetURL + " failed, cause: " + ce.getMessage());
- getLog().debug(ce); // dump on debug
} catch (Exception ex) {
- getLog().error(ex.getClass().getName() + " " + ex.getMessage());
- ex.printStackTrace();
+ throw new MojoExecutionException("Installation on " + targetURL + " failed, cause: " + ex.getMessage(), ex);
} finally {
filePost.releaseConnection();
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.