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
Rebuilding Maven indexes Stuck at 0%
提问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 企业版
回答by Honza Zidek
- Leave Eclipse
- Go to [your-workspace-folder]
- Remove .metadata/.plugins/org.eclipse.m2e.core/nexus
- Remove .metadata/.plugins/org.maven.ide.eclipse/nexus
- Restart Eclipse
- 离开 Eclipse
- 转到 [您的工作区文件夹]
- 删除 .metadata/.plugins/org.eclipse.m2e.core/nexus
- 删除 .metadata/.plugins/org.maven.ide.eclipse/nexus
- 重启 Eclipse
If it does not help, try also
如果它没有帮助,也试试
- remove [your-home-folder]/.m2/repository/.cache/m2e/${m2e.version}.
- 删除 [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(当然你必须安装它):
回答by Mihai
Do this, just as Honza Zidekdid:
这样做,就像Honza Zidek所做的那样:
- Leave Eclipse
- Go to [your-workspace-folder]
- Remove .metadata/.plugins/org.eclipse.m2e.core/nexus
- Remove .metadata/.plugins/org.maven.ide.eclipse/nexus
- Restart Eclipse
- remove [your-home-folder]/.m2/repository/.cache/m2e.
- 离开 Eclipse
- 转到 [您的工作区文件夹]
- 删除 .metadata/.plugins/org.eclipse.m2e.core/nexus
- 删除 .metadata/.plugins/org.maven.ide.eclipse/nexus
- 重启 Eclipse
- 删除 [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 文件夹已定位)。