Skip to content

Cache archive artifacts from Maven repositories - #425

Open
gilesw wants to merge 1 commit into
git-pkgs:mainfrom
gilesw:feat/maven-archive-artifacts
Open

gilesw wants to merge 1 commit into
git-pkgs:mainfrom
gilesw:feat/maven-archive-artifacts

Conversation

@gilesw

@gilesw gilesw commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

The Maven handler caches only .jar, .war, .ear, .pom, .aar, .klib and .module files. Everything else goes to proxyUpstream, uncached, so distributions published as archives on Maven Central, such as org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.tar.gz, are fetched from upstream on every request.

This adds .zip, .tar.gz, .tgz, .tar.bz2 and .tar.xz to the artifact extensions. They take the same path as jars, including the Gradle Plugin Portal fallback, and are listed under their group:artifact name. Checksums and signatures (.tar.gz.sha512 etc.) still match isMetadataFile first, so they're unchanged.

Tested with go test ./... and golangci-lint run ./... (v2.13.1, 0 issues), and by running the proxy against Maven Central: the first fetch of apache-maven-3.9.9-bin.tar.gz took 1.7s, the second 16ms from cache, and /api/search?ecosystem=maven lists org.apache.maven:apache-maven.

The Maven handler cached only .jar, .war, .ear, .pom, .aar, .klib and
.module files, so distributions published as archives, such as
apache-maven-{version}-bin.tar.gz, were proxied uncached on every request.
.zip, .tar.gz, .tgz, .tar.bz2 and .tar.xz files now go through the artifact
cache like other artifacts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant