Skip to content

Maven build failures #474

Closed
Closed

Description

@gilesw

Highly likely this is human error on my part but I'm struggling with some errors on my maven builds in forgejo where I've injected this maven config. Most of a dependencies are working, i.e downloading from the proxy.

<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0">
  <mirrors>
    <mirror>
      <id>pkgsproxy</id>
      <mirrorOf>central</mirrorOf>
      <url>http://<pkgproxy>:8080/maven/</url>
    </mirror>
  </mirrors>
</settings>

cat config.yaml
# Ansible managed
listen: "0.0.0.0:8080"
base_url: "http://<pkgsproxy>:8080"
http_timeout: "5m"
cache_metadata: true

storage:
  url: "file:///var/cache/pkgsproxy"
  max_size: ""

database:
  driver: "sqlite"
  path: "/var/lib/pkgsproxy/proxy.db"
  url: ""

log:
  level: "info"
  format: "text"

access_log:
  path: ""

upstream:
  allow_private_hosts: []
  allow_loopback: false
  generic:
    apache-archive: https://archive.apache.org
    github: https://github.com
    github-api: https://api.github.com
    godl: https://dl.google.com/go
    gosumdb: https://sum.golang.org
    nodejs: https://nodejs.org
  generic_artifacts:
    apache-archive:
    - dist/(?P<name>maven)/maven-3/(?P<version>[^/]+)/binaries/(?P<file>[^/]+)
    - dist/maven/(?P<name>mvnd)/(?P<version>[^/]+)/(?P<file>[^/]+)
    godl:
    - (?P<file>go(?P<version>[0-9][^/]*?)\.[a-z0-9]+-[a-z0-9]+\.(?:tar\.gz|zip)(?:\.sha256)?)
    nodejs:
    - dist/(?P<version>v[0-9][^/]*)/(?P<file>[^/]+)

gradle:
  build_cache:
    read_only: false
    max_upload_size: "100MB"
    max_age: "168h"
    sweep_interval: "10m"

health:
  storage_probe_interval: "30s"

cooldown:
  {}

the errors i'm getting on the second run are as an example

 [WARNING] Could not validate integrity of download from http://xxxxx:8080/maven/org/apache/maven/surefire/surefire-api/3.0.0-M5/surefire-api-3.0.0-M5.pom

and the fatal error

ERROR] Error resolving version for plugin 'org.codehaus.mojo:tomcat-maven-plugin' from the repositories [local (/root/.m2/xxxx), pkgsproxy (http://xxx:8080/maven/)]: Plugin not found in any plugin repository -> [Help 1]#

Activity

  1. gilesw commented on Oct 14, 2026

    @gilesw
    ContributorAuthor

    multiple runs have removed the error but the warnings remain

  2. andrew commented on Oct 14, 2026

    @andrew
    Contributor

    I couldn't reproduce this on current main: through the proxy, surefire-api-3.0.0-M5.pom and its .sha1 match each other and Maven Central, both on the first fetch and from cache, and org/codehaus/mojo/tomcat-maven-plugin/maven-metadata.xml comes through unchanged. A few things would help narrow it down:

    • The proxy version (proxy -version) and the Maven version from the Forgejo runner.
    • The mvn -X output around one of the integrity warnings, which shows the checksum Maven expected, what it got, and where it fetched it from.
    • The proxy's log lines (status code and duration) for that .pom, its .sha1, and the tomcat-maven-plugin maven-metadata.xml from the run that failed.
  3. gilesw commented on Oct 14, 2026

    @gilesw
    ContributorAuthor

    hi @andrew sorry you were an eager beaver before i managed to get back on this thread. I found a few things that have been fixed with some pr's I've just added. Some things weren't being cache because I had central which I've now swapped with * but then I was also rate limited then banned by maven central. I've submitted a set of new pr's that handle the rate limiting and cache the checksums to cover that rate limiting.

  4. andrew commented on Oct 15, 2026

    @andrew
    Contributor

    Thanks for tracking this down. <mirrorOf>*</mirrorOf> explains the missing plugin, and #484 now caches checksum and signature files with their artifacts, so a build no longer refetches them from Central each run. The rate-limit handling is being worked through in #483.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions