简体   繁体   English

Eclipse/Maven - 无法更新索引并添加新的依赖项

[英]Eclipse/Maven - can't update index and add new dependencies

I read this question about basic usage of Maven in Eclipse.我在 Eclipse 中阅读有关 Maven 基本用法的问题。 First time I followed the instructions in the accepted answer it worked fine but now, when I try to do that again, it fails.我第一次按照接受的答案中的说明进行操作时效果很好,但是现在,当我再次尝试这样做时,它失败了。

  1. Rebuilding the index doesn't seem to work - it returns immediately (first time it took 15-20 minutes or so).重建索引似乎不起作用 - 它立即返回(第一次需要 15-20 分钟左右)。
  2. When I right-click on Central and switch between Enable minimum index and Full index enabled I get this error message:当我右键单击Central并在Enable minimum indexFull index enabled之间切换时,我收到以下错误消息:

Error setting index details, Unable to set index details due to the following error, no such file or directory

  1. When trying to add a dependency in the dependency view, it just finds stuff that is already in the workspace.当尝试在依赖项视图中添加依赖项时,它只会找到工作区中已经存在的东西。

What I have done to remedy this:我做了什么来解决这个问题:

  • Preferences -> Maven -> Download repository index updates on startup - checked and unchecked Preferences -> Maven -> Download repository index updates on startup - 选中和未选中
  • Restarted Eclipse重启 Eclipse
  • Deleted the Nexus directory specified in the error message删除了错误信息中指定的Nexus目录
  • Created an empty file _di.cfs .创建了一个空文件_di.cfs This lead to some error message about reading beyond EOF.这会导致一些关于超出 EOF 的读取的错误消息。

Your Eclipse workspace is now corrupted.您的 Eclipse 工作区现已损坏。 Never modify those files directly.切勿直接修改这些文件。 Your best strategy at this point is to create a new workspace.此时最好的策略是创建一个新的工作区。

Accept the fact that building a full index from scratch takes a long time.接受从头开始构建完整索引需要很长时间的事实。 It's not clear to me what the value is of a full index vs. a minimum index.我不清楚完整索引与最小索引的值是多少。 I wouldn't bother with using a full index at this point.在这一点上,我不会为使用完整索引而烦恼。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM