Skip to content

ApiRunner may ignore localRepo when mvnup's Session is discovere #13469

Closed

Description

@ikxeno

Affected version

4.1.0-SNAPSHOT

Bug description

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

  1. added
    bug
    on Oct 13, 2026
  2. added 8 commits that reference this issue on Oct 13, 2026
    b06a219
    34163d3
    13dae0d
    8f5389f
    94a564a
    0f0abca
    700711d
    5f3ca7a
  3. added a commit that references this issue on Oct 15, 2026
    f5778f5
  4. added a commit that references this issue on Oct 16, 2026
    3e1cb91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions