You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2020/10/02 14:51:00 UTC

[jira] [Commented] (MNG-6994) Clarify remote repository resolution order

    [ https://issues.apache.org/jira/browse/MNG-6994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17206230#comment-17206230 ] 

Konrad Windszus commented on MNG-6994:
--------------------------------------

My empirical tests show the following order for downloading assets from repositories
1. Global settings
2. User settings
3. Local POM (profile repos first)
4. Parent POMs (profiles repos first)
5. Super POM (profiles repos first)

It is weird though that the profiles in the individual files seem to be sorted bottom up, i.e. repositories in the last profile are listed first (independent of id).
If multiple repositories are listed in below a {{<repositories>}} element they are always tried in declaration order (again independent of id)

> Clarify remote repository resolution order
> ------------------------------------------
>
>                 Key: MNG-6994
>                 URL: https://issues.apache.org/jira/browse/MNG-6994
>             Project: Maven
>          Issue Type: Improvement
>          Components: Documentation:  General
>            Reporter: Konrad Windszus
>            Priority: Major
>
> It is possible to declare remote repositories in {{settings.xml}} and {{pom.xml}}. While for the {{settings.xml}} it has to be given in a profile, for {{pom.xml}} it can be given in the top-level {{repositories}} element as well as in profiles. The order in which an artifact is tried to be resolved from the different remote repo is sometimes crucial to know (e.g. to speed up build times by first checking against remote repos having most of the artifacts like Maven Central)
> It would be nice to document this in https://maven.apache.org/guides/introduction/introduction-to-repositories.html



--
This message was sent by Atlassian Jira
(v8.3.4#803005)