m2eclipse cannot update index from central repo

安稳与你 提交于 2019-11-29 01:48:36

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

Just add this mirror to the settings.xml:

<mirror>
  <id>ibiblio.org</id>
  <url>http://mirrors.ibiblio.org/maven2</url>
  <mirrorOf>central</mirrorOf>
</mirror>

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>

Changes in both global and user specific settings/xml are needed in order custom maven installation to work inside eclipse. I don't know why but it helped for me.

If the problem is not about connection/proxy, try a more drastic way: delete the whole .metadata folder. Later import projects from their place or checkout them from the svn(if you use some). This is not much more complicated, but it helped. the problem is that we don't really know, what metadata are broken, so the natural next step is to delete all of them. I think, it is the deepest possible cleaning before reinstallation of Eclipse + plugins.

To avoid having to change the settings in 2 places and just rely on the global settings this works nicely:

ln -s /etc/maven2/settings.xml ~/.m2/settings.xml
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!