slachiewicz opened a new pull request, #2125: URL: https://github.com/apache/maven-resolver/pull/2125
Ports the tracking-key part of #2080 and #2104 to the 1.9.x line. `master` selects the function through `RepositoryKeyFunctionFactory` and `aether.lrm.enhanced.trackingRepositoryKeyFunction`; 1.9.x has no key-function layer, so the manager gains a small `TrackingKeyFunction` enum and the property lives in this line's namespace as `aether.enhancedLocalRepository.trackingRepositoryKeyFunction`, next to `trackingFilename`. The repository component of a `_remote.repositories` entry was the bare repository id, so any two repositories that share an id were one origin as far as the enhanced local repository manager is concerned. The entry is now `<id>-<sha1(url)>`, with the context folded into the hash for repository managers. That is byte for byte the `nid_hurl` shape `master` writes, so a local repository shared between Maven 3.9 and Maven 4 reads and writes the same entries. Path composition and split prefixes keep using the id alone; only the tracking entries change. **Upgrade impact, please weigh before merging.** An entry written under the old shape does not match a lookup under the new one. The artifact stays tracked, so the untracked-file branch does not accept it, and it is fetched again once through the checksum-verified path. On first run after upgrading, that is a re-download of every remotely cached artifact a build touches. `master` accepted the same trade for 2.0.23; on 1.9.x the population is every Maven 3.9 user. Setting the property to `nid` restores the old shape. Tests: a repository with the same id and a different URL no longer matches; the written key has the qualified shape; the `nid` opt-out matches by id. All three also run under the split layout through `EnhancedSplitLocalRepositoryManagerTest`. Verified: `mvn -pl maven-resolver-impl -am verify` -> BUILD SUCCESS, 389 tests in the module, 0 failures, 1 skipped (pre-existing); `spotless:apply` produced no further changes. *This change was created with AI assistance.* -- 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]
