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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 11:04:52  来源:igfitidea点击:

How do I enable index downloads in Eclipse for Maven dependency search?

javaeclipsemaven

提问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.

索引下载被禁用,搜索结果可能不完整。

enter image description here

在此处输入图片说明

How can I enable index downloads?

如何启用索引下载?

采纳答案by Bohne

  1. In Eclipse, click on Windows > Preferences, and then choose Mavenin the left side.
  2. Check the box "Download repository index updates on startup".
    • Optionally, check the boxes Download Artifact Sourcesand Download Artifact JavaDoc.
  3. Click OK. The warning won't appear anymore.
  4. Restart Eclipse.
  1. 在 Eclipse 中,单击Windows > Preferences,然后在左侧选择Maven
  2. 选中“启动时下载存储库索引更新”框。
    • 或者,选中“下载工件源”和“下载工件 JavaDoc”框。
  3. 单击“确定”。警告将不再出现。
  4. 重新启动 Eclipse。

http://i.imgur.com/IJ2T3vc.png

http://i.imgur.com/IJ2T3vc.png

回答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.

重建可能需要很长时间,具体取决于您的互联网连接速度,但最终它会奏效。