Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

m2eclipse cannot update index from central repo

I have just downloaded and installed M2Eclipse, but it fails to update the index of the central repo. At the same time, Maven itself is able to download artifacts from the repo (via command line).

I had the settings.xml file in maven/conf, and I copied it to .m2/ directory, but it didn't help.

I have proxy, but proxy settings are given in settings.xml - commands from command line work fine, but not in Eclipse. In Eclipse it gives me this:

Unable to update index for central|http://repo1.maven.org/maven2

UPDATE:

This is what I get when I try to create a new Maven Project:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
Could not resolve artifact
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Documents and Settings\user\.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Documents and Settings\user\.m2\repository)
like image 354
lakeoffm Avatar asked Mar 22 '11 13:03

lakeoffm


3 Answers

Please check your m2eclipse installations configuration, have you pointed it to the correct settings.xml file ?

enter image description here

like image 142
Alois Cochard Avatar answered Nov 05 '22 08:11

Alois Cochard


Just add this mirror to the settings.xml:

<mirror>
  <id>ibiblio.org</id>
  <url>http://mirrors.ibiblio.org/maven2</url>
  <mirrorOf>central</mirrorOf>
</mirror>
like image 24
Roman C Avatar answered Nov 05 '22 07:11

Roman C


if you are behind a proxy do your proxy settings on your usersettings file as below

<proxies>
    <proxy>
        <id>myId</id>
        <active>true</active>
        <protocol>http</protocol>
        <username>MyUser</username>
        <password>MyPassword</password>
        <host>my.proxy.host</host>
        <port>myproxyport</port>
        <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
</proxies>
like image 4
dursun Avatar answered Nov 05 '22 06:11

dursun