Page 1 of 1

Maven index updating

Posted: Sun May 20, 2012 9:43 am
by csilk
I'm trying to update the Maven repository index via Eclipse as per the instructions (http://wiki.broadleafcommerce.org/confl ... or+Eclipse) but I'm getting the following error: Unable to update index for central|http://repo1.maven.org/maven2

I have tried removing the cache and metadata from my Eclipse workspace then restarting eclipse and starting the indexing again but this never works (this is the advice given everywhere on the internet when there are problems updating the Index). I still get the error at around 36% of the 'updating indexes' task.

Any idea what could be causing this or do you know of a manual way to update the index as I can download the .gz file via the browser without any problems?

Note, I'm on a standard 6mb ADSL connection. I'm not going through a proxy.

Thanks
Craig

Re: Maven index updating

Posted: Wed May 23, 2012 5:36 am
by aniem
Hi Craig,

I stumbled over the same problem (hitting me always at exactly 8%).

You can have a look into Eclipse's logfile to get some more detailled information about the error (located in .metadata/.log within your workspace directory). In my case the log told me that a timeout occurred while retreiving data from Maven Central.

I'm located in Germany so I added an european mirror to the Maven configuration. My assumption was that it couldn't be a bad idea to reduce the geographical distance a bit. A list of mirrors can be found here: http://docs.codehaus.org/display/MAVENUSER/Mirrors+Repositories. Note that the "independently synced" mirrors are not all completly synced. For example the one in Cologne doesn't contain the Boradleaf archetype but the french one works fine now for me.

In order to add the mirror you have to edit /path/to/your/homedir/.m2/settings.xml. If it doesn't exist, you have to create a new one using this template:

Code: Select all

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers/>
  <mirrors>
  </mirrors>
  <proxies/>
  <profiles/>
  <activeProfiles/>
</settings>


You can then add one of the mirrors to the <mirrors/> list and restart Eclipse. It will automatically use the mirror as a replacement for Maven Central. In my case that was a lot faster and finally solved the problem.

Hope this helps,
Alex

Re: Maven index updating

Posted: Wed May 23, 2012 3:18 pm
by csilk
Thanks Aniem,

I changed to the French mirror (the British one didn't work) and not only did the update work but it ran quite fast too!

Thanks for the help.