Re: Per-dependency repository resolution in Maven?
Gary Gregory <[email protected]> Wed, 11 Feb 2026 09:06:47 -0500
| Newsgroups | gmane.comp.jakarta.turbine.maven.user |
|---|---|
| Message-ID | <CACZkXPxZDxo8vySNWhFRNE_zEUi8OgReb6DGs6e4MJrhavLhpg@mail.gmail.com> |
I would use such a feature (at work)! Gary On Wed, Feb 11, 2026, 08:26 Yeikel Santana <[email protected]> wrote: > Currently, Maven resolves artifacts from repositories in order and does > not allow specifying a repository per dependency. > > > In scenarios where the same artifact coordinates may exist in multiple > repositories, there does not appear to be a built-in way to enforce that a > specific dependency be resolved only from a specific repository. > > > Has per-dependency repository resolution ever been discussed or considered > in Maven’s design? Not as a default but as a feature that could be enabled > > > The goal would be to enforce that certain artifacts (for example, internal > coordinates) must only be resolved from a designated repository, and that > the build should fail if they are resolved from any other repository even > if the artifact exists in multiple registries. > > > In Gradle, in case it matters, this is done via "includeGroup" [1] > > > > https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api.artifacts.repositories/-inclusive-repository-content-descriptor/include-group.html > > > Thanks