aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Multiple Repositorys in Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Multiple Repositorys in Maven" Watch "Multiple Repositorys in Maven" New topic
Author

Multiple Repositorys in Maven

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
Hi,

I have to use two different locations to download different set of jar file, I am very new to Maven so need some basic help.

I added both the repository under <repositories> tag,but the build fails for the files for second repository, i don't know how do i tell maven that for a perticular dependency use different repository ?

-P


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21



I think I've overdone it on this one, but I don't want to break anything finding out!


Customer surveys are for companies who didn't pay proper attention to begin with.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
Thanks much tim, i have similar POM but i wonder how maven understand what repository to use for a given artifact?

i have all required files defined in <dependency> as below.



now i have a repos for files in 2nd dependency tag and NEW repos for 1st Dependency tag so i added new repository tag as below



so for files mention in first depdencey it searches repos 1 where as its located in repos 2.

-P
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

The answer is - "all of them"!

Maven is based on the idea that anything in a repository is a fixed release, and once released, it will never change. So which repository you get a release from is immaterial - one is as good as another.

If you make fuzzy version requests, this can cause trouble, since there's a possibility of catching a release that wasn't propagated to other participating repositories. But making fuzzy version requests is a good way to ensure getting Maven's version of DLL Hell. I recommend always keying for specific releases unless there's a strong reason not to.

There probably is something like a "best-fit" rule that gets around problems where different versions have different, but equally eligible releases. I haven't checked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Repositorys in Maven