]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5035 Trim properties read from sonar-runner configuration files
authorJulien HENRY <julien.henry@sonarsource.com>
Fri, 21 Mar 2014 12:31:31 +0000 (13:31 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Fri, 21 Mar 2014 12:32:39 +0000 (13:32 +0100)
sonar-batch/src/main/java/org/sonar/batch/scan/DefaultProjectBootstrapper.java
sonar-batch/src/test/resources/org/sonar/batch/scan/DefaultProjectBootstrapperTest/multi-module-definitions-in-each-module/module1/sonar-project.properties
sonar-batch/src/test/resources/org/sonar/batch/scan/DefaultProjectBootstrapperTest/multi-module-definitions-in-each-module/sonar-project.properties

index c84b9d5a2f103cc98d641db51fa2fd557b3a6062..528891fadc8c92b84974e76352c22585d294413c 100644 (file)
@@ -277,6 +277,10 @@ class DefaultProjectBootstrapper implements ProjectBootstrapper {
     } finally {
       IOUtils.closeQuietly(fileInputStream);
     }
+    // Trim properties
+    for (String propKey : propsFromFile.stringPropertyNames()) {
+      propsFromFile.setProperty(propKey, StringUtils.trim(propsFromFile.getProperty(propKey)));
+    }
     return propsFromFile;
   }
 
index df58736407774ea6c2d6a480e18a59e642423109..2f16886c91d1b8584af3e89397184ecee87dcda6 100644 (file)
@@ -1,7 +1,7 @@
-sonar.projectKey=com.foo.project
+sonar.projectKey=com.foo.project 
 sonar.projectName=Foo Project
 sonar.projectVersion=1.0-SNAPSHOT
-sonar.projectDescription=Description of Foo Project
+sonar.projectDescription=Description of Foo Project 
 
 sonar.tests=tests
 sonar.binaries=target/classes