rmannibucau opened a new pull request, #14083: URL: https://github.com/apache/maven/pull/14083
Fixes #14082. ## Summary Reuse cached artifacts independently of their recorded remote repository origin by default for unsplit enhanced local repositories, including individual members of a chain. This is implemented entirely in Maven, without modifying or upgrading Resolver: - Add a Maven `LocalRepositoryManagerFactory` that delegates to the enhanced factory and decorates artifact lookup. An unavailable result is accepted only when the enhanced manager returned a validated existing path. - Preserve file existence and real-path checks, provenance recording, metadata lookup, chain ordering, and installation/download write routing. Do not rename tracking files or fabricate a remote origin. - Add `maven.repo.local.ignoreAvailability` as an explicit policy override. Split repositories retain strict defaults. An explicit strict tail policy suppresses automatic relaxation; an explicit new-property value overrides that automatic policy. - Preserve existing Resolver tail-bypass semantics: setting the new property to `false` does not itself disable the existing default tail bypass. Strict checking of every chain member also requires `maven.repo.local.tail.ignoreAvailability=false`. - Document configuration precedence, migration from the alternate tracking-filename workaround, snapshot/metadata limitations, and the trust implications of accepting cache content across repository changes. ## Tests Added focused enhanced-manager tests, native/Sisu discovery and derived-session coverage, workspace precedence coverage, and CLI integration tests for repeated invocations with changed repository identity, offline reuse, strict mode, split repositories, and head/tail chains. Validation performed locally: - Full `maven-impl` and `maven-core` test suites: 1,886 tests, no failures or errors, 4 skipped. - Built and installed the Maven distribution with `mvn -B -pl apache-maven -am -DskipTests install`. - Ran the new CLI IT and selected repository-order, repository-access, custom-local-repository and reactor/project-local-repository regression ITs against the built distribution: 13 tests, no failures, errors or skips. - Scoped Spotless checks passed for changed files using JDK 21; `git diff --check` passed. The complete core integration-test suite has not been run. ## Compatibility / trust policy Different repositories can serve different bytes at identical coordinates. The new default intentionally trusts artifacts already in an unsplit local cache across repository configuration changes. Origin-sensitive users can opt out or use isolated/split repositories. Metadata and snapshot version discovery remain repository-sensitive; this does not guarantee that every snapshot build works offline. -- 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]
