Skip to content

Use Google Maven Central mirror - #1785

Merged
andrew merged 3 commits into
mainfrom
maven-google-mirror
Aug 12, 2026
Merged

Use Google Maven Central mirror#1785
andrew merged 3 commits into
mainfrom
maven-google-mirror

Conversation

@andrew

@andrew andrew commented Aug 12, 2026

Copy link
Copy Markdown
Member

Sonatype's repo.maven.apache.org and repo1.maven.org both return 403 from the production server IP regardless of User-Agent, while maven-central.storage-download.googleapis.com serves the same artifact tree and returns 200.

  • Adds the Google mirror URL to MAVEN_CENTRAL_URLS so is_maven_central? and supports_archetype_catalog? recognise it
  • Updates the seed URL for the default maven registry and seeds rate_limit: 2
  • Caches the effective POM body per version in fetch_effective_pom so dependencies_metadata reuses what versions_metadata already fetched instead of requesting the same .pom again, cutting per-version requests from 3 (.pom, .pom, .jar.sha1) to 2

Production needs the registry row updated via console after deploy:

Registry.find_by_name!("repo1.maven.org").update!(url: "https://maven-central.storage-download.googleapis.com/maven2", rate_limit: 2)

andrew added 3 commits August 12, 2026 15:58
Sonatype's repo.maven.apache.org and repo1.maven.org both return 403
from the production server IP regardless of User-Agent, while
maven-central.storage-download.googleapis.com serves the same
artifact tree and returns 200. Add the Google mirror URL to the set
is_maven_central? and supports_archetype_catalog? recognise, and
update the seed URL for the default maven registry.

The production registry row needs its url updated via console.
…data fetch

versions_metadata already fetches and caches each version's .pom via
download_pom, but dependencies_metadata made its own uncached
request(url) for the same file, so every new version fetched its
.pom twice. fetch_effective_pom now memoizes the effective-pom body
plus the Last-Modified header; fetch_pom parses from that cache and
dependencies_metadata reads the body from it, cutting per-version
requests from 3 (.pom, .pom, .jar.sha1) to 2.
@andrew
andrew merged commit d991ad7 into main Aug 12, 2026
7 checks passed
@andrew
andrew deleted the maven-google-mirror branch August 12, 2026 15:14
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