0

In the pom.xml I can define repositories and dependencies, but I do not see a way to declare which dependencies should be taken from which repository. For example, dependency A should be loaded from repository X and dependency B - from repository Y, with a different URL. How do I declare this in my pom.xml and/or settings.xml?

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
  • Maven 3 lookups for dependencies in the order that repositories are declared. It will use the first available. – leoconco Sep 30 '21 at 17:03
  • Short answer to this: It's not possible. Furthermore repositories should not being defined in your pom file...use settings.xml for that or even better use a repository manager...there you can defined such rules.. – khmarbaise Sep 30 '21 at 17:18

2 Answers2

0

You cannot.

But you do not need to care.

Maven goes through all the declared repositories to look for the dependencies. So it will eventually find them.

J Fabian Meier
  • 30,532
  • 9
  • 61
  • 119
0

Maven 3 lookups for dependencies in the order that repositories are declared. It will use the first available. Maven repository lookup order

leoconco
  • 233
  • 3
  • 14