summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-maven3-plugin/src/main/java/org/sonar/maven3/Maven3PluginExecutor.java8
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);
+ }
}
}