]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2861 fix loading of property sonar.skippedModules
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 10 Oct 2011 15:14:19 +0000 (17:14 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 10 Oct 2011 15:14:19 +0000 (17:14 +0200)
sonar-batch/src/main/java/org/sonar/batch/ProjectTree.java

index 7d9524ca93bc93c78c92d6c86f3911ddb884d0c2..06ec2bd23fde90470200bc5a79f614202e8e84c3 100644 (file)
@@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory;
 import org.sonar.api.batch.bootstrap.ProjectBuilder;
 import org.sonar.api.batch.bootstrap.ProjectDefinition;
 import org.sonar.api.batch.bootstrap.ProjectReactor;
+import org.sonar.api.config.Settings;
 import org.sonar.api.resources.Project;
 
 import java.io.IOException;
@@ -40,17 +41,21 @@ public class ProjectTree {
 
   private List<Project> projects;
   private Map<ProjectDefinition, Project> projectsByDef;
+  private Settings settings;
 
   public ProjectTree(ProjectReactor projectReactor, //NOSONAR the unused parameter 'builders' is used for the startup order of components
                      ProjectConfigurator projectConfigurator,
+                     Settings settings,
                      /* Must be executed after ProjectBuilders */ ProjectBuilder[] builders) {
-    this(projectReactor, projectConfigurator);
+    this(projectReactor, projectConfigurator, settings);
   }
 
   public ProjectTree(ProjectReactor projectReactor, //NOSONAR the unused parameter 'builders' is used for the startup order of components
-                     ProjectConfigurator projectConfigurator) {
+                     ProjectConfigurator projectConfigurator,
+                     Settings settings) {
     this.projectReactor = projectReactor;
     this.configurator = projectConfigurator;
+    this.settings = settings;
   }
 
   ProjectTree(ProjectConfigurator configurator) {
@@ -89,8 +94,8 @@ public class ProjectTree {
 
   void applyExclusions() {
     for (Project project : projects) {
-      String[] excludedArtifactIds = project.getConfiguration().getStringArray("sonar.skippedModules");
-      String[] includedArtifactIds = project.getConfiguration().getStringArray("sonar.includedModules");
+      String[] excludedArtifactIds = settings.getStringArray("sonar.skippedModules");
+      String[] includedArtifactIds = settings.getStringArray("sonar.includedModules");
 
       Set<String> includedModulesIdSet = Sets.newHashSet();
       Set<String> excludedModulesIdSet = Sets.newHashSet();