]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SQSCANNER-121 Fix QA execution by using Cirrus provided build version
authorMatteo Mara <matteo.mara@sonarsource.com>
Tue, 10 Oct 2023 14:12:58 +0000 (16:12 +0200)
committerMatteo Mara <98599122+matteo-mara-sonarsource@users.noreply.github.com>
Thu, 12 Oct 2023 12:14:34 +0000 (14:14 +0200)
it/pom.xml

index 4ac0b3755fd79fb2a1d41ea55011f9b11bf34c13..bbbde14699700fb1086950209f96c2d40a9919cc 100644 (file)
@@ -74,7 +74,7 @@
           <artifactId>maven-surefire-plugin</artifactId>
           <configuration>
             <systemProperties>
-              <scanner.version>${scanner.version}</scanner.version>
+              <scanner.version>${env.PROJECT_VERSION}</scanner.version>
             </systemProperties>
             <includes>
               <include>**/SonarScannerTestSuite.java</include>
       <id>download-qa-artifacts</id>
       <activation>
         <property>
-          <name>env.CI_BUILD_NUMBER</name>
+          <name>env.PROJECT_VERSION</name>
         </property>
       </activation>
       <build>
         <plugins>
-          <plugin>
-            <groupId>org.codehaus.gmaven</groupId>
-            <artifactId>groovy-maven-plugin</artifactId>
-            <version>2.0</version>
-            <executions>
-              <execution>
-                <id>compute-qa-version</id>
-                <phase>initialize</phase>
-                <goals>
-                  <goal>execute</goal>
-                </goals>
-                <configuration>
-                  <source><![CDATA[
-                    String pom = new File(project.basedir, '../pom.xml').getText('UTF-8')
-                    def matcher = pom =~ /(?s).*<version>(.*?)-SNAPSHOT<\/version>.*/
-                    assert matcher.matches()
-                    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>
-              </execution>
-            </executions>
-          </plugin>
-
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-dependency-plugin</artifactId>
                   <goal>get</goal>
                 </goals>
                 <configuration>
-                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip</artifact>
+                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip</artifact>
                 </configuration>
               </execution>
               <execution>
                   <goal>get</goal>
                 </goals>
                 <configuration>
-                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip:linux</artifact>
+                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:linux</artifact>
                 </configuration>
               </execution>
               <execution>
                   <goal>get</goal>
                 </goals>
                 <configuration>
-                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip:windows</artifact>
+                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:windows</artifact>
                 </configuration>
               </execution>
               <execution>
                   <goal>get</goal>
                 </goals>
                 <configuration>
-                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip:macosx</artifact>
+                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${env.PROJECT_VERSION}:zip:macosx</artifact>
                 </configuration>
               </execution>
             </executions>