aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-10-18 09:46:07 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-10-18 09:46:07 +0200
commit5bfec46b1e2216a2b892b0f681c903c55571ac82 (patch)
treea39a43f4d03bc558a482c2ea7d3ba696518098ea
parent6e343b341c799a593df4de2154764afdda0713e1 (diff)
downloadsonarqube-5bfec46b1e2216a2b892b0f681c903c55571ac82.tar.gz
sonarqube-5bfec46b1e2216a2b892b0f681c903c55571ac82.zip
SONAR-2914 Add the parameter sonar.verbose
-rw-r--r--sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java10
-rw-r--r--sonar-maven3-plugin/src/main/java/org/sonar/maven3/SonarMojo.java11
2 files changed, 19 insertions, 2 deletions
diff --git a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java
index 89b5190ba97..4b15f15076a 100644
--- a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java
+++ b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java
@@ -132,6 +132,11 @@ 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();
@@ -154,7 +159,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/maven/logback.xml");
}
}
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");
}
}