From aef2dad6d5322fdc17873b09e55bd7a7effa2f5c Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Thu, 11 Apr 2024 19:40:43 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20improve=20`pom=20version`=20check=20?= =?UTF-8?q?=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 49 ++++++++++++++++++++++++++++++++-------- scripts/integration_test | 2 +- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 923a565d..43cf8d20 100644 --- a/pom.xml +++ b/pom.xml @@ -67,6 +67,8 @@ UTF-8 ${project.build.sourceEncoding} false + ^\d(\.\d+)?\.(\d+|x)-SNAPSHOT$ + ^\d\.\d+\.\d+(-(Alpha|Beta|RC)\d+)?$ 4.8.2 3.0.2 @@ -305,10 +307,6 @@ - - - 3.3.9 - + + 3.3.9 + + + + project.version + ${maven.enforcer.pom.version.regex} + Project version(${project.version}) format is invalid! + @@ -511,6 +519,7 @@ + enforce-when-release @@ -532,12 +541,6 @@ 21 - - - project.version - ^\d\.\d+\.\d+(-(Alpha|Beta|RC)\d+)?$|^\d(\.\d+)?\.(\d+|x)-SNAPSHOT$ - "Project version(${project.version}) format is invalid!" - ${maven.compiler.source} @@ -557,6 +560,32 @@ + + enforce-project-version-when-release + + + performRelease + true + + + + ${release.pom.version.regex} + + + + enforce-project-version-when-github-actions-triggered-by-tag + + + + env.GITHUB_REF_TYPE + tag + + + + ${release.pom.version.regex} + + + gen-src diff --git a/scripts/integration_test b/scripts/integration_test index 28a1778b..912ac546 100755 --- a/scripts/integration_test +++ b/scripts/integration_test @@ -31,7 +31,7 @@ readonly JDK_VERSIONS=( # shellcheck disable=SC2034 readonly MVU_MVN_OPTS=( "${MVU_DEFAULT_MVN_OPTS[@]}" - -DperformRelease -P'!gen-sign' + -DperformRelease -P'!gen-sign' -P'!enforce-project-version-when-release' ${CI_MORE_MVN_OPTS:+${CI_MORE_MVN_OPTS}} )