views:

533

answers:

2

everytime i start with a fresh new workspace, m2eclipse downloads nexus-maven-repository-index.gz from the maven central repository. this is good. but, some times, i just want to start a new workspace, and not wait for it to download, it tried copying the whole .metadata directory from an old workspace to the new one, but the list of maven artifacts are still empty. is there a way i can cache it? or at least download the file once, and the copy/extract/repackage it so that m2eclipse thinks it has already downloaded it and allows me to search for maven artifacts.

or a short version of the question where and in what format is the "nexus-maven-repository-index.gz" file stored in the workspace?

A: 

The index is stored in the plugin's metadata location, i.e.

[workspace root]/.metadata/.plugins/org.maven.ide.eclipse/nexus

There will be one folder for each remote repository index in use.

You can configure the plugin to not download the index at startup too. Got to Window->Preferences->Maven and uncheck Download repository indexes at startup, you'll have to remember to reactivate it to get any updates though

Update: I just verified that copying the metadata works. M2Eclipse will still contact the repository to download the deltas (assuming the above option is checked), but that only takes a few moments as it is only downloading the deltas.

Rich Seller
A: 

Depending on your situation, you may want to try running a managed repository such as artifactory or nexus.

Configure it as the one-true-source-of-everything in maven, that way the initial download should only be from a local location and hence fast.

Kevin Wright