Failed to execute goal on project hello: Could not resolve dependencies for project com.hu:hello:jar

时间:2022-09-03 22:56:59

一、背景

出现这种问题的背景:项目是我从原来的电脑的迁移过来的,eclipse和tomcat都是最新配置的,jdk也是最新安装的。

在这种环境下出现了这种错误。Failed to execute goal on project hello: Could not resolve dependencies for project com.hu:hello:jar,翻译过来就是不来为项目解决以来问题。

二、解决方法

按下面的截图来做

1、先找到项目下的JRE库,如图一;右键点击该库–>build path–>configure build path…

图一:
Failed to execute goal on project hello: Could not resolve dependencies for project com.hu:hello:jar

2、图二就是选中Maven Dependencies 然后remove,再然后ok。

图二:
Failed to execute goal on project hello: Could not resolve dependencies for project com.hu:hello:jar

3、选中项目,右键–>Maven–>Update Project
Failed to execute goal on project hello: Could not resolve dependencies for project com.hu:hello:jar

4、选中截图中的选项,点击OK。maven的依赖就会解决。
Failed to execute goal on project hello: Could not resolve dependencies for project com.hu:hello:jar