aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/pom.xml
diff options
context:
space:
mode:
authorssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2017-02-27 08:01:54 +0100
committerssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2017-02-27 08:01:54 +0100
commit13d4b5aeb8d5fc381100c31f39fd713dcc9850e1 (patch)
tree817d79ae343a3aa37ee14aeb6ff917503b77981d /sonar-plugin-api/pom.xml
parent76beaef7ac313675aafa7afc3cec60f289a911a1 (diff)
parente688583dee96e6a41d03b057234005678732d25f (diff)
downloadsonarqube-13d4b5aeb8d5fc381100c31f39fd713dcc9850e1.tar.gz
sonarqube-13d4b5aeb8d5fc381100c31f39fd713dcc9850e1.zip
Automatic merge from branch-6.3
* origin/branch-6.3: BUILD-384 Replace usage of groovy-maven-plugin (not compliant with Maven paraller execution) by beanshell-maven-plugin
Diffstat (limited to 'sonar-plugin-api/pom.xml')
-rw-r--r--sonar-plugin-api/pom.xml51
1 files changed, 28 insertions, 23 deletions
diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml
index ed5ab293ba8..a982696bda0 100644
--- a/sonar-plugin-api/pom.xml
+++ b/sonar-plugin-api/pom.xml
@@ -224,32 +224,37 @@
</executions>
</plugin>
<plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>compute-version-on-three-fields</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <source><![CDATA[
+ <groupId>com.github.genthaler</groupId>
+ <artifactId>beanshell-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>compute-version-on-three-fields</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <script>
+ <![CDATA[
if (! "${buildVersion}".endsWith("-SNAPSHOT")) {
- String apiVersion
- String[] fields = "${buildVersion}".tokenize('.')
- if (fields.length > 3) {
- apiVersion = fields[0..2].join('.')
- } else {
- apiVersion = fields.join('.')
+ // example: "6.3.0.1234". To be backward-compatible with scanners, only "6.3.0" must be kept
+ fields = "${buildVersion}".split("\\.");
+ sj = new StringJoiner(".");
+ i = 0;
+ for (String field : fields) {
+ if (i == 3) {
+ break;
+ }
+ sj.add(field);
+ ++i;
}
- project.properties['buildVersionOnThreeFields'] = apiVersion
+ project.getProperties().setProperty("buildVersionOnThreeFields", sj.toString());
}
- ]]>
- </source>
- </configuration>
- </execution>
- </executions>
+ ]]>
+ </script>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>