AdobeDocs / experience-manager-cloud-manager.en

This is the repository for Adobe Experience Manager Cloud Manager documentation. Your contributions to the documentation are welcome.
https://experienceleague.adobe.com/en/docs/experience-manager-cloud-manager/content/introduction
Other
12 stars 31 forks source link

Clarify repository order in merged settings.xml #33

Closed kwin closed 3 years ago

kwin commented 3 years ago

Issue in help/using/setting-up-project.md

As it is now possible to add custom repositories to the merged settings.xml it is sometimes important to know if the custom repository is added as first or last choice (after server ids adobe, cloud-manager and central or before them). In most of the cases the custom repository should be tried last (as no other repo should have the artifact with the same coordinates) but for some edge cases you might also want to overwrite an artifact also available with the same GAV in another repo.

justinedelson commented 3 years ago

@kwin I'm not sure I follow your question and this seems like an implementation detail. If the merged settings.xml has

<servers>
  <server>
    <id>adobe</id>
  </server>
  <server>
    <id>my-custom</id>
  </server>
</servers>

or

<servers>
  <server>
    <id>my-custom</id>
  </server>
  <server>
    <id>adobe</id>
  </server>
</servers>

Does this have a functional impact? The ids are unique so I don't believe the order in the merged settings.xml really matters.

kwin commented 3 years ago

This is not about the server ids but about the repository ids. The question is whether Maven tries to download from custom repo first or last (after central and adobe)!

justinedelson commented 3 years ago

Ah... isn't that a question for Maven then?

kwin commented 3 years ago

First of all one needs to know how you merge the settings.xml because the order depends on the profile declaration order in the merged settings.xml! Compare also with https://issues.apache.org/jira/browse/MNG-6994.

justinedelson commented 3 years ago

That's the part I'm not following -- per the documentation, only the <server> elements are merged by Cloud Manager. If there's some reason that the order of these need to be guaranteed, we can do that and ensure it is documented, but AFAIK the order of the <server> elements is not important since those are only ever used by id reference.

kwin commented 3 years ago

Indeed, this is defined by Maven. There is no possibility to add a repo which is tried before adobe or central. The pom repository is always asked after all repositories from settings.xml