Skip to content

Commit d95ccbd

Browse files
committed
release-version.sh: try again with -U as needed
It's nice if, when failing to extract the version due to dependencies not being present in the remote repository, we first try again using -U before giving up. Otherwise, we may end up with the unfortunate error: Failure to find <artifact> in https://maven.scijava.org/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of scijava.public has elapsed or updates are forced If the artifact has been successfully deployed after the local system last checked for it, but 24 hours has not yet elapsed, the -U flag will force a new check to find the artifact, and the release can continue.
1 parent 47781f9 commit d95ccbd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

release-version.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ Options include:
112112

113113
# -- Extract project details --
114114

115-
projectDetails=$(mvn -N -Dexec.executable='echo' -Dexec.args='${project.version}:${license.licenseName}:${project.parent.groupId}:${project.parent.artifactId}:${project.parent.version}' exec:exec -q)
115+
echoArg='${project.version}:${license.licenseName}:${project.parent.groupId}:${project.parent.artifactId}:${project.parent.version}'
116+
projectDetails=$(mvn -N -U -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
117+
test $? -eq 0 || projectDetails=$(mvn -U -N -Dexec.executable=echo -Dexec.args="$echoArg" exec:exec -q)
116118
test $? -eq 0 || die "Could not extract version from pom.xml. Error follows:\n$projectDetails"
117119
currentVersion=${projectDetails%%:*}
118120
projectDetails=${projectDetails#*:}

0 commit comments

Comments
 (0)