Skip to content

Commit 8c5e3bd

Browse files
committed
release-version: skip license check if POM says so
1 parent 8b1eabf commit 8c5e3bd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

release-version.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Options include:
118118
# -- Extract project details --
119119
debug "Extracting project details"
120120

121-
echoArg='${project.version}:${license.licenseName}:${project.parent.groupId}:${project.parent.artifactId}:${project.parent.version}'
121+
echoArg='${project.version}:${license.licenseName}:${project.parent.groupId}:${project.parent.artifactId}:${project.parent.version}:${license.skipUpdateProjectLicense}'
122122
projectDetails=$(mvn -B -N -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
123123
test $? -eq 0 || projectDetails=$(mvn -B -U -N -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
124124
test $? -eq 0 || die "Could not extract version from pom.xml. Error follows:\n$projectDetails"
@@ -132,7 +132,9 @@ projectDetails=$(printf '%s' "$projectDetails" | tr -d '\n')
132132
currentVersion=${projectDetails%%:*}
133133
projectDetails=${projectDetails#*:}
134134
licenseName=${projectDetails%%:*}
135-
parentGAV=${projectDetails#*:}
135+
projectDetails=${projectDetails#*:}
136+
parentGAV=${projectDetails%%:*}
137+
skipUpdateProjectLicense=${projectDetails#*:}
136138

137139
# -- Sanity checks --
138140
debug "Performing sanity checks"
@@ -315,7 +317,7 @@ then
315317
fi
316318

317319
# Ensure license headers are up-to-date.
318-
test "$SKIP_LICENSE_UPDATE" -o -z "$licenseName" -o "$licenseName" = "N/A" || {
320+
test "$SKIP_LICENSE_UPDATE" -o -z "$licenseName" -o "$licenseName" = "N/A" -o "$skipUpdateProjectLicense" = "true" || {
319321
debug "Ensuring that license headers are up-to-date"
320322
mvn license:update-project-license license:update-file-header &&
321323
git add LICENSE.txt || die 'Failed to update copyright blurbs.

0 commit comments

Comments
 (0)