This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Many Maven repositories in pom.xml or settings.xml mirrors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Many Maven repositories in pom.xml or settings.xml mirrors" Watch "Many Maven repositories in pom.xml or settings.xml mirrors" New topic
Author

Many Maven repositories in pom.xml or settings.xml mirrors

Pierre Le Roux
Greenhorn

Joined: Feb 09, 2012
Posts: 2
Hello,

I would like to declare repositories in pom.xml or mirrors in settings.xml.

My aim is to retrieve some artifact from maven central and some others from oss sonatype public.

for this i declared 2 repositories :
* either in my pom like this

* either in my settings.xml like this :


I would like Maven to do this process :
if the package doesn't exist on the first repository, it tries to find it on the second one.

Is there a way to do it without using a custom repository such as Archiva or nexus ?

Thanks for you help.
Pierre Le Roux
Greenhorn

Joined: Feb 09, 2012
Posts: 2
OK.

There's no problem for those who use Maven 2.2.1 but problem appears since Maven 3.

I just created a bug on http://jira.codehaus.org/browse/MNG-5241
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

That's good to know. I always expected the repositories to be searched in the order in which they appear.


JBoss In Action
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Many Maven repositories in pom.xml or settings.xml mirrors
 
Similar Threads
(RESOLVED) Re: Could not find repository
Why is Eclipse/Maven project not picking up the values from settings.xml?
Build project from the Local Repository instead of Remote Repository
Maven - plugin downoading problem
Maven Local repository Vs nexus