Java 如何在 Eclipse 中为 Maven 依赖项搜索启用索引下载?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24252256/
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
How do I enable index downloads in Eclipse for Maven dependency search?
提问by Ashish
I am using Eclipse Luna with the m2e plug-in. When I search for dependencies, I get the following warning (also see the screenshot after):
我正在使用带有 m2e 插件的 Eclipse Luna。当我搜索依赖项时,我收到以下警告(另请参见后面的屏幕截图):
Index downloads are disabled, search result may be incomplete.
索引下载被禁用,搜索结果可能不完整。
How can I enable index downloads?
如何启用索引下载?
采纳答案by Bohne
- In Eclipse, click on Windows > Preferences, and then choose Mavenin the left side.
- Check the box "Download repository index updates on startup".
- Optionally, check the boxes Download Artifact Sourcesand Download Artifact JavaDoc.
- Click OK. The warning won't appear anymore.
- Restart Eclipse.
- 在 Eclipse 中,单击Windows > Preferences,然后在左侧选择Maven。
- 选中“启动时下载存储库索引更新”框。
- 或者,选中“下载工件源”和“下载工件 JavaDoc”框。
- 单击“确定”。警告将不再出现。
- 重新启动 Eclipse。
回答by Shahbaaz
Tick 'Full Index Enabled' and then 'Rebuild Index' of the central repository in 'Global Repositories' under Window > Show View > Other > Maven > Maven Repositories
, and it should work.
勾选“启用完整索引”,然后勾选“全局存储库”下中央存储库的“重建索引” Window > Show View > Other > Maven > Maven Repositories
,它应该可以工作。
The rebuilding may take a long time depending on the speed of your internet connection, but eventually it works.
重建可能需要很长时间,具体取决于您的互联网连接速度,但最终它会奏效。