From 5bfec46b1e2216a2b892b0f681c903c55571ac82 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 18 Oct 2011 09:46:07 +0200 Subject: SONAR-2914 Add the parameter sonar.verbose --- .../src/main/java/org/sonar/maven3/SonarMojo.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sonar-maven3-plugin/src') diff --git a/sonar-maven3-plugin/src/main/java/org/sonar/maven3/SonarMojo.java b/sonar-maven3-plugin/src/main/java/org/sonar/maven3/SonarMojo.java index eabc913e42a..f8de98e99c6 100644 --- a/sonar-maven3-plugin/src/main/java/org/sonar/maven3/SonarMojo.java +++ b/sonar-maven3-plugin/src/main/java/org/sonar/maven3/SonarMojo.java @@ -125,6 +125,12 @@ public final class SonarMojo extends AbstractMojo { */ private RuntimeInformation runtimeInformation; + /** + * @parameter expression="${sonar.verbose}" default-value="false" + */ + private boolean verbose; + + public void execute() throws MojoExecutionException, MojoFailureException { configureLogback(); executeBatch(); @@ -147,7 +153,10 @@ public final class SonarMojo extends AbstractMojo { } private void configureLogback() { - System.setProperty("ROOT_LOGGER_LEVEL", getLog().isDebugEnabled() ? "DEBUG" : "INFO"); + boolean debugMode = (verbose || getLog().isDebugEnabled()); + + // this system property is required by the logback configuration + System.setProperty("ROOT_LOGGER_LEVEL", debugMode ? "DEBUG" : "INFO"); Logback.configure("/org/sonar/maven3/logback.xml"); } } -- cgit v1.2.3