]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
Fix QA script 3.0.1.733
authorJulien HENRY <julien.henry@sonarsource.com>
Wed, 12 Apr 2017 15:07:01 +0000 (17:07 +0200)
committerJulien HENRY <henryju@yahoo.fr>
Wed, 12 Apr 2017 18:57:37 +0000 (20:57 +0200)
it/pom.xml

index 4e3e09002666910e082cd612a059080d1cab9d9e..0eefad727afba29de7aa08ad3331ecb261dd673a 100644 (file)
                     String pom = new File(project.basedir, '../pom.xml').getText('UTF-8')
                     def matcher = pom =~ /(?s).*<version>(.*?)-SNAPSHOT<\/version>.*/
                     assert matcher.matches()
-                    project.properties['scanner.version'] = matcher[0][1] + '.0.' + System.getenv()['CI_BUILD_NUMBER']
+                    def versionNoSnapshot = matcher[0][1]
+                    if (new StringTokenizer(versionNoSnapshot, ".").countTokens() == 2) {
+                      versionNoSnapshot += '.0'
+                    }
+                    project.properties['scanner.version'] = versionNoSnapshot + '.' + System.getenv()['CI_BUILD_NUMBER']
                     ]]>
                   </source>
                 </configuration>