From 021c5a25e8fda96f760f005686328f3f487e146e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 4 Jun 2022 15:49:01 +0200 Subject: [PATCH] chore: Check for SNAPSHOT build tools and other SNAPSHOTs --- do-release.sh | 8 ++++++++ pom.xml | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/do-release.sh b/do-release.sh index 5cd900bf32..3ddb331bbd 100755 --- a/do-release.sh +++ b/do-release.sh @@ -72,6 +72,14 @@ export RELEASE_VERSION export DEVELOPMENT_VERSION export CURRENT_BRANCH +# check for SNAPSHOT version of pmd.build-tools.version +BUILD_TOOLS_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=pmd.build-tools.version -q -DforceStdout) +BUILD_TOOLS_VERSION_RELEASE=${BUILD_TOOLS_VERSION%-SNAPSHOT} +if [ "${BUILD_TOOLS_VERSION}" != "${BUILD_TOOLS_VERSION_RELEASE}" ]; then + echo "Error: version pmd.build-tools.version is ${BUILD_TOOLS_VERSION} - snapshot is not allowed" + exit 1 +fi + RELEASE_RULESET="pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml" echo "* Update date info in **docs/_config.yml**." diff --git a/pom.xml b/pom.xml index c5119da86e..f9a643d105 100644 --- a/pom.xml +++ b/pom.xml @@ -364,7 +364,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M2 + 3.0.0 org.apache.maven.plugins @@ -431,6 +431,11 @@ + + org.apache.maven.plugins + maven-site-plugin + 4.0.0-M1 + org.codehaus.mojo versions-maven-plugin @@ -495,6 +500,33 @@ + + enforce-no-snapshots + + enforce + + + + + No Snapshots Allowed! + true + + + + + + enforce-plugin-versions + + enforce + + + + + Best Practice is to always define plugin versions! + + + +