Skip to content

Commit dfb5cf9

Browse files
committed
Remove no-longer-functional cache invalidation
With the upgrade from Nexus v2 to v3, this trick no longer works. I briefly investigated how to adjust the code to still do it, but was not immediately successful at doing so. Claude.ai suggests: # Invalidate specific paths using the browse API # First, you'd need to identify the asset and use: curl --netrc -X DELETE \ "$NEXUS_BASE_URL/service/rest/v1/assets/{assetId}" But I do not know if this would actually work, and I do not know how to obtain the assetId for a given resource. We can figure it out later if needed. But first, let's proceed without it for a while, to see what problems it creates.
1 parent a74c2dd commit dfb5cf9

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

ci-build.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -336,20 +336,6 @@ EOL
336336
done
337337
fi
338338

339-
if [ "$deployOK" -a "$success" -eq 0 ]; then
340-
echo
341-
echo "== Invalidating SciJava Maven repository cache =="
342-
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/bdd932af4c4816f88cb6a52cdd7449f175934634/maven-helper.sh &&
343-
gav=$(sh maven-helper.sh gav-from-pom pom.xml) &&
344-
ga=${gav%:*} &&
345-
echo "--> Artifact to invalidate = $ga" &&
346-
echo "machine maven.scijava.org" >"$HOME/.netrc" &&
347-
echo " login $MAVEN_USER" >>"$HOME/.netrc" &&
348-
echo " password $MAVEN_PASS" >>"$HOME/.netrc" &&
349-
sh maven-helper.sh invalidate-cache "$ga"
350-
checkSuccess $?
351-
fi
352-
353339
echo ::endgroup::
354340
fi
355341

maven-helper.sh

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -232,29 +232,6 @@ latest_version () {
232232
echo "$latest"
233233
}
234234

235-
# Given a GA parameter, invalidate the cache in SciJava's Nexus' group/public
236-
237-
SONATYPE_DATA_CACHE_URL=https://maven.scijava.org/service/local/data_cache/repositories/sonatype/content
238-
SONATYPE_SNAPSHOTS_DATA_CACHE_URL=https://maven.scijava.org/service/local/data_cache/repositories/sonatype-snapshots/content
239-
invalidate_cache () {
240-
ga="$1"
241-
artifactId="$(artifactId "$ga")"
242-
infix="$(groupId "$ga" | tr . /)/$artifactId"
243-
curl --netrc -i -X DELETE \
244-
$SONATYPE_DATA_CACHE_URL/$infix/maven-metadata.xml &&
245-
curl --netrc -i -X DELETE \
246-
$SONATYPE_SNAPSHOTS_DATA_CACHE_URL/$infix/maven-metadata.xml &&
247-
version="$(latest_version "$ga")" &&
248-
infix="$infix/$version" &&
249-
curl --netrc -i -X DELETE \
250-
$SONATYPE_DATA_CACHE_URL/$infix/$artifactId-$version.pom &&
251-
if test "$artifactId" = "${artifactId#pom-}"
252-
then
253-
curl --netrc -i -X DELETE \
254-
$SONATYPE_DATA_CACHE_URL/$infix/$artifactId-$version.jar
255-
fi
256-
}
257-
258235
# Generate a temporary file; not thread-safe
259236

260237
tmpfile () {
@@ -477,9 +454,6 @@ all-deps|all-dependencies)
477454
latest-version)
478455
latest_version "$2"
479456
;;
480-
invalidate-cache)
481-
invalidate_cache "$2"
482-
;;
483457
gav-from-pom)
484458
gav_from_pom "$2"
485459
;;
@@ -530,11 +504,6 @@ latest-version <groupId>:<artifactId>[:<version>]
530504
passed as version, it prints the current snapshot version rather
531505
than the release one).
532506
533-
invalidate-cache <groupId>:<artifactId>
534-
Invalidates the version cached in the SciJava Nexus from OSS Sonatype,
535-
e.g. after releasing a new version to Sonatype. Requires appropriate
536-
credentials in $HOME/.netrc for https://maven.scijava.org/.
537-
538507
parent-gav <groupId>:<artifactId>[:<version>]
539508
Prints the GAV parameter of the parent project of the given artifact.
540509

0 commit comments

Comments
 (0)