views:

480

answers:

2

Hello ,
Is there any to get the entire remote repository , say from http://repo1.maven.org/maven2/ , to my local repository (to %USERPROFILE%)?

Thanks in advance for the help.

Srinivas N

+2  A: 

I'm not sure how you would do that using Maven. It might be useful to explain what you are trying to achieve - at a guess you want a local cache?

What you might be looking for really is a local repository manager like Sonatype's Nexus. These repository managers provide a local cache for remote repositories, as well as providing somewhere for you to put your code.

Brabster
Yes but all the time i need to be online.. That's the part i want to avoid , the works goes offline
srinannapa
+10  A: 

From http://maven.apache.org/community.html:

Being a Good Maven Citizen

The concept of a public repository built into the core architecture of Maven makes it necessarily community-centric. There are a few simple things that Maven users may do to help keep that community thriving.

Be a Kind Public Repository User

The best thing that a user can do is to set up their own remote repository mirror containing the projects needed. There are several tools to make this simpler, such as Nexus or Archiva. This reduces strain on the Maven central repository, and allows new users to get acquainted with Maven easier and quicker. This is especially important for power-users and corporations. The incentive behind this is, controlling your own servers can give you desired level of security and more control over uptime, resulting in a better experience for your users. With that said, keep the following sentiment in mind:

DO NOT wget THE ENTIRE REPOSITORY!

Please take only the jars you need. We understand this is may entail more work, but grabbing all 9+ Gigs of binaries really kills our servers.

Host a Mirror

As an extention to the previous statement, if you have access to a large data repository with lots of bandwidth, please consider becomming a mirror for the Maven central repository.

As you can imagine, thousands of users downloading can put quite a strain on one server. If you wish to be a mirror, please file a request in the Maven Project Administration JIRA project.

Host a Public Repository

If you have any projects that you wish others to use, host them on your own public repository. That way, your users can simply add your repository to their own project repo list, and viola! Maven can keep you and your users in synch, growing your user-base due simply to its new-found ease of use.

Maybe if you explain why you'd like to get the whole central repo in %USERPROFILE% I could provide a better answer (if you you need to go offline, there are smarter solutions than getting 9+ gigs of artifacts). But for now, I don't get the point.

Pascal Thivent
Hello thaks for your reply , After downloading the entire repository to my local %USERPROFILE% , i must upload the entire content(jars..) to the internal-repository.. and i need to distribute that internal repository .. Yes it must be an offiline job once the internal repository is set
srinannapa
@srinannapa Don't crawl the entire repository, use what you need only, use a proxying enterprise repository. If you need to distribute 9+ Gigs of binaries, there **must be** something wrong with your approach...
Pascal Thivent
Don't you think when you need to set up a repository for the first time in an corporate where you need to work offline ???? Do you have any other approach.
srinannapa
@srinannapa You won't convince me that you'll need the entire repository. And if you think you do, still, don't crawl the entire repository. Contact the maven guys and see how to setup a mirror. Everything is written black on white above. BTW, if you need to google something, are you going to crawl the entire web?!?
Pascal Thivent
Some times it is useful if you save the the web pages for quick ref., and when i'm not online that won't stop my work. What do you feel about rsync ?? but no idea who allows this rsync repo1.mavem.com?? or any other mirror?
srinannapa
@srinannapa Get in touch with the Maven PMC and discuss this with them. I've added a link to their Jira. Also have a look at http://www.sonatype.com/people/2008/12/maintain-an-essential-public-resource-the-central-maven-repository/.
Pascal Thivent