Ayush0612005 commented on issue #281:
URL: 
https://github.com/apache/maven-artifact-plugin/issues/281#issuecomment-6577779218

   I reproduced this with Maven 3.9.16, Java 25.0.1 and the released plugin 
3.7.0, using a small resource-only JAR with a fixed output timestamp and 
separate settings files.
   
   | Configuration | Result |
   | --- | --- |
   | No mirror, default `reference.repo=central` | Success: both reference 
files match |
   | Mirror ID `mirror-central`, `mirrorOf=central`, default reference ID | 
Fails with `Could not find repository with id = central`, after the local 
install succeeds |
   | Same mirror, explicit `reference.repo=mirror-central` | Success: both 
reference files match |
   
   The mirror uses the same Central URL in this experiment, so the changed 
repository identity is sufficient to expose the failure.
   
   I've also added tests first against master `f65da1a9`, with production code 
unchanged:
   
https://github.com/Ayush0612005/maven-artifact-plugin/commit/ce083d9c4ef7dbc12cddbe3e1ac1c2fe1afc3fdf
   
   The unit suite reports 10 tests: 2 expected failures, 8 passes, no test 
errors. The failing cases select a mirror through an original repository ID, 
including a mirror representing several originals. Passing controls retain 
direct repository/mirror ID lookup and reject unknown IDs or unrelated mirrors. 
The tests require returning the effective repository instance, preserving its 
URL, policies, authentication and proxy. Checkstyle and RAT passed.
   
   `createReferenceRepo()` currently searches only effective repository IDs 
before throwing. My proposed next step is to retain exact effective-ID matching 
first, then check the effective repositories' `getMirroredRepositories()` 
metadata for the original ID. This would preserve Maven's selected mirror and 
its configuration. I'd also keep URL and `id::url` handling on their existing 
Resolver path and cover those forms when preparing the fix.
   
   Does that lookup scope fit the intended semantics? The fork branch is 
intentionally red as regression evidence; I haven't opened an upstream PR or 
implemented the production change yet.
   
   AI assistance: Codex helped inspect the code, run the reproduction and 
prepare these tests/comment.
   


-- 
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