gnodet opened a new pull request, #2134:
URL: https://github.com/apache/maven-resolver/pull/2134

   ## Problem
   
   PR #2133 added a legacy tracking fallback for entries written by older 
resolvers using ID-only keys (`nid` format). However, it does **not** fix the 
actual Maven IT failures.
   
   The real problem (identified by @cstamas): when ITs run, support artifacts 
are installed from real Central, producing `nid_hurl` tracking entries:
   ```
   sisu-maven-plugin-1.1.0.jar>central-8fac3ebd6edbaca3c794783fa38088af0aa128e7=
   ```
   where `8fac3ebd...` = `sha1(https://repo.maven.apache.org/maven2)`.
   
   Then each IT overrides `central` to `file:target/null` to prevent remote 
access. The resolver looks for:
   ```
   sisu-maven-plugin-1.1.0.jar>central-<sha1(file:target/null)>=
   ```
   
   The sha1 hashes differ → exact lookup misses → artifact treated as "present 
but unavailable" → tries to download from `file:target/null` → 💥. All 9 IT jobs 
fail (4229 failures across 507 test classes).
   
   ## Fix
   
   Add a second fallback stage inside the existing `legacyTrackingFallback` 
guard: after the legacy ID-only check, scan tracking entries for any key 
matching the repo-ID prefix (`repoId-`). This accepts artifacts tracked under 
the same logical repository identity regardless of the URL hash suffix.
   
   The prefix uses `repoId-` (with the dash separator from the `nid_hurl` 
format) to avoid false positives with repos whose ID shares a prefix (e.g. 
`central` must not match `centralbackup-<sha1>`).
   
   ## Tests
   
   - `testUrlQualifiedTrackingSameIdDifferentUrlAcceptedViaFallback`: 
same-id-different-URL now accepted (was: `assertFalse`)
   - `testUrlQualifiedTrackingAcceptsSameIdDifferentUrlEntries`: **new** — 
simulates the IT scenario (Central → `file:target/null`)
   - Updated factory tests to reflect relaxed same-id behavior
   - All 587 resolver tests pass
   
   ## Related
   
   - Follow-up to #2133
   - Fixes [apache/maven#13078 
(comment)](https://github.com/apache/maven/pull/13078#issuecomment-5583775310)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to