求助:Eclipse中右键central无Maven索引重建选项怎么办
解决Eclipse Maven依赖搜索无结果且无法重建central索引的问题
方法1:手动补充本地仓库索引文件
- 打开Eclipse的
Window > Preferences > Maven > User Settings,确认User Settings和Local Repository路径配置正确 - 若本地Maven仓库的
.index目录(无则手动新建)下缺少索引文件,前往Maven中央仓库的索引目录下载nexus-maven-repository-index.gz和nexus-maven-repository-index.properties文件 - 将下载的文件放入本地仓库的
.index目录,重启Eclipse - 打开
Window > Show View > Other > Maven > Maven Repositories,找到central仓库,右键即可看到Rebuild Index选项
方法2:更新/降级Maven集成插件
- 部分旧版Maven插件存在右键选项缺失的bug,操作步骤:
- 打开
Help > Eclipse Marketplace - 搜索
Maven Integration for Eclipse,选择更新到最新稳定版,或切换到已知兼容的版本 - 重启Eclipse后重新检查右键菜单
- 打开
方法3:重置Maven插件配置
- 关闭Eclipse,找到当前工作区下的
.metadata/.plugins/org.eclipse.m2e.core目录,删除该目录下的所有内容 - 重新启动Eclipse,Maven插件会自动初始化配置
- 再次进入Maven Repositories视图,尝试右键central仓库
方法4:手动重新添加central仓库
- 打开
Window > Preferences > Maven > Repositories - 点击
Add按钮,手动配置central仓库:- Id:
central - URL:
https://repo1.maven.org/maven2/
- Id:
- 点击
Apply and Close,回到Maven Repositories视图,找到新添加的central仓库,右键选择Rebuild Index
内容的提问来源于stack exchange,提问作者SpartanCao
相关产品推荐
相关产品推荐

