eclipse 重建 Maven 索引卡在 0%

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36087225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 23:05:28  来源:igfitidea点击:

Rebuilding Maven indexes Stuck at 0%

javaeclipsespringmaven

提问by Mohammed Adel

I am trying to rebuild the Maven index in Eclipse, but it has been stuck at 0% for hours.

我正在尝试在 Eclipse 中重建 Maven 索引,但它一直停留在 0% 几个小时。

I can't find any results when trying to add dependencies. I have tried running Eclipse as an Administrator and ticking "update repositories" on startup, but neither option worked.

尝试添加依赖项时我找不到任何结果。我曾尝试以管理员身份运行 Eclipse 并在启动时勾选“更新存储库”,但两个选项都不起作用。

I am using Windows 8.1 Enterprise Edition

我使用的是 Windows 8.1 企业版

Rebuilding Indexes: (0%)

重建指数:(0%)

回答by Honza Zidek

  1. Leave Eclipse
  2. Go to [your-workspace-folder]
  3. Remove .metadata/.plugins/org.eclipse.m2e.core/nexus
  4. Remove .metadata/.plugins/org.maven.ide.eclipse/nexus
  5. Restart Eclipse
  1. 离开 Eclipse
  2. 转到 [您的工作区文件夹]
  3. 删除 .metadata/.plugins/org.eclipse.m2e.core/nexus
  4. 删除 .metadata/.plugins/org.maven.ide.eclipse/nexus
  5. 重启 Eclipse

If it does not help, try also

如果它没有帮助,也试试

  1. remove [your-home-folder]/.m2/repository/.cache/m2e/${m2e.version}.
  1. 删除 [your-home-folder]/.m2/repository/.cache/m2e/${m2e.version}。

See also https://stackoverflow.com/a/16444984/2886891

另见https://stackoverflow.com/a/16444984/2886891



To preventthe impact of various bugs from the m2e plugin, I prefer using always the externalmaven (you have to have it installedof course):

为了防止m2e 插件的各种错误的影响,我更喜欢始终使用外部maven(当然你必须安装它):

enter image description here

在此处输入图片说明

回答by Mihai

Do this, just as Honza Zidekdid:

这样做,就像Honza Zidek所做的那样:

  1. Leave Eclipse
  2. Go to [your-workspace-folder]
  3. Remove .metadata/.plugins/org.eclipse.m2e.core/nexus
  4. Remove .metadata/.plugins/org.maven.ide.eclipse/nexus
  5. Restart Eclipse
  6. remove [your-home-folder]/.m2/repository/.cache/m2e.
  1. 离开 Eclipse
  2. 转到 [您的工作区文件夹]
  3. 删除 .metadata/.plugins/org.eclipse.m2e.core/nexus
  4. 删除 .metadata/.plugins/org.maven.ide.eclipse/nexus
  5. 重启 Eclipse
  6. 删除 [your-home-folder]/.m2/repository/.cache/m2e。

Click Window -> Show view -> Other -> Maven Repositories In the appeared tab click Global Repositories. Right click on central -> Rebuild Index.

单击 Window -> Show view -> Other -> Maven Repositories 在出现的选项卡中单击 Global Repositories。右键单击中央 -> 重建索引。

It took me 30 minutes to rebuild it. All the time Progress bar was 0%. Eclipse downloaded about 10Gb in [your-home-folder]/.m2/repository folder. Then it deleted 8Gb.

我花了 30 分钟才重建它。所有的时间进度条都是 0%。Eclipse 在 [your-home-folder]/.m2/repository 文件夹中下载了大约 10Gb。然后它删除了8Gb。

To check if download is going, just refresh C drive (or the drive .m2 folder is loceted).

要检查下载是否正在进行,只需刷新 C 驱动器(或驱动器 .m2 文件夹已定位)。