File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Shared Maven Local Repository? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Shared Maven Local Repository?" Watch "Shared Maven Local Repository?" New topic

Shared Maven Local Repository?

Swerrgy Smith
Ranch Hand

Joined: Mar 26, 2010
Posts: 91
Hi all,

We are a group of developers who use Maven for a J2EE project.
How can I create and configure a shared local repository on my computer so that other developers can access and use its libraries? (Otherwise, each developer must have a separate .m2 directory and download the same libraries from the central repository).

Thank you very much.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17276

Actually, you are better off dedicating an independent server computer to do this, since it can be a real nuisance to asymmetrically configure a desktop machine to act as a server. A popular approach is to use Sonatype's Nexus server software, which can cache both universal artefacts and local project artefacts.

You actually don't want to eliminate the ".m2" cache, since its primary purpose is to speed up compiles with a side benefit of not having to keep separate copies of the artefacts in each individual project. But by using a central server, you can reduce Internet overhead and at the same time publish internal shared objects.

An IDE is no substitute for an Intelligent Developer.
Peter Johnson

Joined: May 14, 2008
Posts: 5852

I'll second Tim's comments. Having a Nexus repository in house is the best way to go. Makes sharing binary artifacts with other people in your company simple. I would also recommend setting up Jenkins to manage your builds.

JBoss In Action
jQuery in Action, 3rd edition
subject: Shared Maven Local Repository?
It's not a secret anymore!