You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ApiRunner may ignore localRepo when mvnup's Session is discovere #13469
I ran into this while working on mvnval (#13276). With Maven CLI classes on the classpath, ApiRunner.createSession(null, requestedRepo, SecurityMode.NONE) can return a Session using ~/.m2/repository instead of requestedRepo. It also has [central, apache-snapshots] as its remote repositories instead of [central]. The reproducer used an isolated user.home and no setting that overrides the local repository.
I ran the same call in 30 fresh JVMs, varying unrelated allocations before session creation. Sixteen runs returned the mvnup Session; fourteen returned ApiRunner's Session. Those counts describe this reproducer, not a failure rate in normal use.
ApiRunner discovers providers and then requests an unqualified Session. The standalone injector also registers mvnup's @Named("mvnup") provider under that key. Both providers have priority 0, so sorting by priority leaves their HashSet iteration order to decide which one wins.
I would expect the unqualified provider to win when priorities tie. If two default providers still tie, the lookup should report ambiguity rather than pick one by iteration order. mvnval corrects the returned session's repository values after creation, but the underlying selection remains order-dependent for other callers.
Activity
Fix apache#13469: cover ambiguous nested bindings
Fix apache#13469: explain binding identity comparison
Fix apache#13469: correct binding comment and lookup documentation
Fix apache#13469: clarify initialized binding diagnostics
Fix apache#13469: tighten binding diagnostics assertion
Fix apache#13469: include initializer identity in diagnostics
Fix apache#13469: stabilize regression and integration tests
Fix apache#13469: preserve local repository paths in ApiRunner
fix: prefer default bindings for unqualified lookups in standalone in…
[Backport maven-4.0.x] Fix #13469: prefer default bindings for unqual…
Chore: use ApiRunner repositories in mvnval (#13648)