Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I update Maven Index manually?

Tags:

eclipse

maven

I have this problem:

When I start Eclipse (Indigo Service Release 1 with Maven Integration for Eclipse) it's trying to download a file from Maven Repositories :

repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz

It reaches about 10-20% (this takes loooong) and then apparently it gives up:

02.05.12 08:47:36 MESZ: Updating index central|http://repo1.maven.org/maven2
02.05.12 09:09:25 MESZ: Unable to update index for central|http://repo1.maven.org/maven2

Now I tried to download this gz-file manually because I thought, the download hits any timeout within Eclipse. Now I have another two problems:

  1. The direct download of the 48,7 MB-gz-file canceled after 9,6 MB. I have no clue why.
  2. If I'd be able to download the gz-file, I don't know how to "put it into" Eclipse/Maven or tell Maven to use the file on my PC and not the repository repo1.maven.org.

Any helpful ideas or answers?

like image 551
nyx Avatar asked May 02 '12 08:05

nyx


People also ask

How do I update my Maven?

icon in the Maven tool window to open the Maven settings. Select Repositories from options on the left. On the Repositories page, click Update to update Maven repositories. After the update is finished, click OK.

How do I force a Maven project to update in Eclipse?

Update Maven settings in Eclipse. Right-click your project and select Maven Update Project and update your project.


2 Answers

  1. Delete the cache from .m2/repository/.cache/m2e.
  2. Open your eclipse
  3. Menu Windows > Preferences > Maven > User Settings > Update Settings

Eclipse will download it again, should work now.

like image 121
Henrique Miranda Avatar answered Sep 20 '22 14:09

Henrique Miranda


Try to change the timeout settings like described here. I do not know which setting is responsible for the repository index update, you have to try a bit...

-Dsun.net.client.defaultReadTimeout=60000
-Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=60000

You should consider to disable the index update on startup (disable: Preferences -> Maven -> Download repository index updates on startup) and only update manually in the Maven Repositories View using the context menu on the central repository.

like image 21
FrVaBe Avatar answered Sep 18 '22 14:09

FrVaBe