diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-07 12:54:34 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-07 13:41:39 +0400 |
commit | 3174a29201e922db758b51f4b693ca131e7037ec (patch) | |
tree | f7a9fe5c07edb62ab25b31722c358bd11f2e0397 | |
parent | 11e8646acab9094f4d1d6be7513f0ec4a0fa2f8e (diff) | |
download | sonarqube-3174a29201e922db758b51f4b693ca131e7037ec.tar.gz sonarqube-3174a29201e922db758b51f4b693ca131e7037ec.zip |
SONAR-2878 Stop analysis if execution of Maven Plugin failed
-rw-r--r-- | sonar-maven3-plugin/src/main/java/org/sonar/maven3/Maven3PluginExecutor.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sonar-maven3-plugin/src/main/java/org/sonar/maven3/Maven3PluginExecutor.java b/sonar-maven3-plugin/src/main/java/org/sonar/maven3/Maven3PluginExecutor.java index b0db20a47c6..873c1d7f8ff 100644 --- a/sonar-maven3-plugin/src/main/java/org/sonar/maven3/Maven3PluginExecutor.java +++ b/sonar-maven3-plugin/src/main/java/org/sonar/maven3/Maven3PluginExecutor.java @@ -19,13 +19,14 @@ */ package org.sonar.maven3; +import java.util.Arrays; + import org.apache.maven.execution.MavenSession; import org.apache.maven.lifecycle.LifecycleExecutor; import org.apache.maven.project.MavenProject; +import org.sonar.api.utils.SonarException; import org.sonar.batch.AbstractMavenPluginExecutor; -import java.util.Arrays; - public class Maven3PluginExecutor extends AbstractMavenPluginExecutor { private LifecycleExecutor lifecycleExecutor; @@ -46,6 +47,9 @@ public class Maven3PluginExecutor extends AbstractMavenPluginExecutor { projectSession.getRequest().setGoals(Arrays.asList(goal)); projectSession.getRequest().setInteractiveMode(false); lifecycleExecutor.execute(projectSession); + if (projectSession.getResult().hasExceptions()) { + throw new SonarException("Exception during execution of " + goal); + } } } |