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?
Asked
Active
Viewed 234 times
0

Mark Rotteveel
- 100,966
- 191
- 140
- 197

user16038501
- 67
- 5
-
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 Answers
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
- 33,516
- 10
- 64
- 142
0
Maven 3 lookups for dependencies in the order that repositories are declared. It will use the first available. Maven repository lookup order

leoconco
- 253
- 3
- 15