Fine tune looking up current version.

This commit is contained in:
Greg L. Turnquist
2023-09-18 12:20:39 -05:00
parent db8043b98c
commit 3d9229c8bb
3 changed files with 9 additions and 9 deletions

View File

@@ -1 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip

4
Jenkinsfile vendored
View File

@@ -178,6 +178,8 @@ pipeline {
returnStdout: true
).trim()
echo "Releasing Spring WS ${PROJECT_VERSION}..."
if (PROJECT_VERSION.matches(/.*-RC[0-9]+$/) || PROJECT_VERSION.matches(/.*-M[0-9]+$/)) {
RELEASE_TYPE = "milestone"
} else if (PROJECT_VERSION.endsWith('SNAPSHOT')) {
@@ -188,6 +190,8 @@ pipeline {
RELEASE_TYPE = 'snapshot'
}
echo "Release type: ${RELEASE_TYPE}"
if (RELEASE_TYPE == 'release') {
STAGING_REPOSITORY_ID = sh(

View File

@@ -2,13 +2,9 @@
set -euo pipefail
RAW_VERSION=`MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.version -q -DforceStdout`
VERSION=`MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate \
-Dexpression=project.version -q -DforceStdout | tail -1`
# Split things up
VERSION_PARTS=($RAW_VERSION)
# Grab the last part, which is the actual version number.
echo ${VERSION_PARTS[${#VERSION_PARTS[@]}-1]}
echo $VERSION