aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/pom.xml
diff options
context:
space:
mode:
authorDavid Rautureau <david.rautureau@sonarsource.com>2017-02-23 09:47:42 +0100
committerDavid Rautureau <david.rautureau@sonarsource.com>2017-02-24 13:27:39 +0100
commite688583dee96e6a41d03b057234005678732d25f (patch)
tree666eb0a7b9defde8103f38d1fffb3e475594e689 /sonar-plugin-api/pom.xml
parent7a8f38e05f2264d550c232cd89518abd1155870a (diff)
downloadsonarqube-e688583dee96e6a41d03b057234005678732d25f.tar.gz
sonarqube-e688583dee96e6a41d03b057234005678732d25f.zip
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 e5dd6de1916..ee6b21c7cf7 100644
--- a/sonar-plugin-api/pom.xml
+++ b/sonar-plugin-api/pom.xml
@@ -229,32 +229,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>