I added the following to the TCK build in Security to make sure the versions don't contain snapshot. We could do the same or similar for security:
# Compute release versions
SNAPSHOT_VERSION=`mvn ${MVN_EXTRA} -B ${HELP_PLUGIN}:evaluate -Dexpression=project.version 2> /dev/null | grep -E '^[0-9]+(\.[0-9]+)+-SNAPSHOT$'`
if [ -z "${RELEASE_VERSION}" ]; then
if [ -z ${SNAPSHOT_VERSION} ]; then
echo '-[ Missing required snapshot version number! ]----------------------------------'
fi
RELEASE_VERSION=`echo ${SNAPSHOT_VERSION} | sed -e 's/-SNAPSHOT//'`
fi
# Bash specific code
if [ -z "${NEXT_VERSION}" ]; then
NEXT_VERSION=`echo ${RELEASE_VERSION} | sed -e 's/\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
set -f
NEXT_COMPONENTS=(${RELEASE_VERSION//\./ })
LAST_INDEX=$((${#NEXT_COMPONENTS[@]} - 1))
NEXT_COMPONENTS[${LAST_INDEX}]=$((${NEXT_COMPONENTS[${LAST_INDEX}]} + 1))
NEXT_VERSION=`echo ${NEXT_COMPONENTS[@]} | tr ' ' '.'`'-SNAPSHOT'
fi
RELEASE_TAG="${RELEASE_VERSION}-RELEASE"
echo "Current version: ${SNAPSHOT_VERSION}"
echo "Release version: ${RELEASE_VERSION}"
echo "Next version: ${NEXT_VERSION}"
echo "Release tag: ${RELEASE_TAG}"
if [ -z "${SNAPSHOT_VERSION}" -o -z "${RELEASE_VERSION}" -o -z "${NEXT_VERSION}" ]; then
echo '-[ Missing required version numbers! ]------------------------------------------'
exit 1
fi
# Set release version if needed
if [ ${SNAPSHOT_VERSION} != ${RELEASE_VERSION} ]; then
echo '-[ Set release version ]--------------------------------------------------------'
cd ${BUILD_DIR}
# Project identifiers
ARTIFACT_ID=$(mvn ${MVN_EXTRA} -B ${HELP_PLUGIN}:evaluate -Dexpression=project.artifactId | grep -Ev '(^\[)')
GROUP_ID=$(mvn ${MVN_EXTRA} -B ${HELP_PLUGIN}:evaluate -Dexpression=project.groupId | grep -Ev '(^\[)')
# Set release version
mvn ${MVN_EXTRA} -U -C \
-DnewVersion="${RELEASE_VERSION}" \
-DgenerateBackupPoms=false \
clean ${VERSIONS_PLUGIN}:set
cd old-tck/build
# Set release version
mvn ${MVN_EXTRA} -U -C \
-DnewVersion="${RELEASE_VERSION}" \
-DgenerateBackupPoms=false \
clean ${VERSIONS_PLUGIN}:set
cd ${WORKSPACE}
echo '-[ Commit modified pom.xml files ]----------------------------------------------'
POM_FILES=`git status | grep -E 'modified:.*pom\.xml' | sed -e 's/[[:space:]][[:space:]]*modified:[[:space:]][[:space:]]*//'`
git add ${POM_FILES} && \
git commit -m "Prepare release ${GROUP_ID}:${ARTIFACT_ID}:${RELEASE_VERSION}"
fi