diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-02-20 21:45:22 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-02-21 10:05:08 +0100 |
commit | 7def7f15c9d024f2941680b3a82bd8a35cbfcd7c (patch) | |
tree | 7f41ec952c077d4334678f9616874e9f62f068de /sonar-plugin-api | |
parent | 5f09ded3a60950b1db7714f70f66850216acbff9 (diff) | |
download | sonarqube-7def7f15c9d024f2941680b3a82bd8a35cbfcd7c.tar.gz sonarqube-7def7f15c9d024f2941680b3a82bd8a35cbfcd7c.zip |
Ability to release versions without build number in artifact filenames
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/pom.xml | 22 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/resources/sonar-api-version.txt | 2 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/resources/sq-version.txt | 2 |
3 files changed, 18 insertions, 8 deletions
diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml index 2cef8a0681f..e5dd6de1916 100644 --- a/sonar-plugin-api/pom.xml +++ b/sonar-plugin-api/pom.xml @@ -14,7 +14,18 @@ <name>SonarQube :: Plugin API</name> <properties> - <project.version.3digits>${project.version}</project.version.3digits> + <!-- + version as stored in JAR and displayed in webapp. It is + overridden on Travis when replacing SNAPSHOT version by + build unique version, for instance "6.3.0.12345". + --> + <buildVersion>${project.version}</buildVersion> + + <!-- + a truncated version on three fields is kept for backward-compatibility + with scanners + --> + <buildVersionOnThreeFields>${buildVersion}</buildVersionOnThreeFields> </properties> <dependencies> @@ -222,23 +233,22 @@ <artifactId>groovy-maven-plugin</artifactId> <executions> <execution> - <id>compute-3digits-version</id> + <id>compute-version-on-three-fields</id> <phase>generate-resources</phase> <goals> <goal>execute</goal> </goals> <configuration> <source><![CDATA[ - if (! "${project.version}".endsWith("-SNAPSHOT")) { + if (! "${buildVersion}".endsWith("-SNAPSHOT")) { String apiVersion - // example: "6.3.0.1234". To be backward-compatible with scanners, only "6.3.0" must be kept - String[] fields = "${project.version}".tokenize('.') + String[] fields = "${buildVersion}".tokenize('.') if (fields.length > 3) { apiVersion = fields[0..2].join('.') } else { apiVersion = fields.join('.') } - project.properties['project.version.3digits'] = apiVersion + project.properties['buildVersionOnThreeFields'] = apiVersion } ]]> </source> diff --git a/sonar-plugin-api/src/main/resources/sonar-api-version.txt b/sonar-plugin-api/src/main/resources/sonar-api-version.txt index ad96e7cf933..6b7ce460f25 100644 --- a/sonar-plugin-api/src/main/resources/sonar-api-version.txt +++ b/sonar-plugin-api/src/main/resources/sonar-api-version.txt @@ -1 +1 @@ -${project.version} +${buildVersion} diff --git a/sonar-plugin-api/src/main/resources/sq-version.txt b/sonar-plugin-api/src/main/resources/sq-version.txt index b9ca09a01c9..ab8c87a30ad 100644 --- a/sonar-plugin-api/src/main/resources/sq-version.txt +++ b/sonar-plugin-api/src/main/resources/sq-version.txt @@ -1 +1 @@ -${project.version.3digits}
\ No newline at end of file +${buildVersionOnThreeFields} |