aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--pom.xml11
-rw-r--r--sonar-plugin-api/pom.xml51
2 files changed, 33 insertions, 29 deletions
diff --git a/pom.xml b/pom.xml
index 6039960ab74..c1bec7d0c10 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,11 +111,6 @@
<version>1.3</version>
</plugin>
<plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
- <version>2.0</version>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
@@ -264,6 +259,11 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
</plugin>
+ <plugin>
+ <groupId>com.github.genthaler</groupId>
+ <artifactId>beanshell-maven-plugin</artifactId>
+ <version>1.2</version>
+ </plugin>
</plugins>
</pluginManagement>
@@ -321,7 +321,6 @@
<plugin>
<groupId>com.github.genthaler</groupId>
<artifactId>beanshell-maven-plugin</artifactId>
- <version>1.2</version>
<executions>
<execution>
<id>randomize-environment</id>
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>