java项目dependences下面报错,红色波浪线

文章讲述了Java项目在依赖管理中遇到的问题,涉及Maven依赖加载失败,原因可能是JDK版本不匹配。解决方案包括重新加载Maven、检查子项目依赖顺序以及使用云原生URL创建支持JDK8的项目。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,问题:java项目dependences下面波浪线

在这里插入图片描述

方法一:重新加载maven依赖(未解决)

在这里插入图片描述
报错:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.486 s
[INFO] Finished at: 2023-12-14T09:27:45+08:00
[INFO] Final Memory: 18M/171M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project logistics-etl: Could not resolve dependencies for project cn.it:logistics-etl:jar:1.0-SNAPSHOT: Failed to collect dependencies at cn.it.logistics.common:logistics-common:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for cn.it.logistics.common:logistics-common:jar:1.0-SNAPSHOT: Could not transfer artifact cn.it.logistics.common:logistics-common:pom:1.0-SNAPSHOT from/to mvnrepository (https://mvnrepository.com/): Access denied to: https://mvnrepository.com/cn/it/logistics/common/logistics-common/1.0-SNAPSHOT/logistics-common-1.0-SNAPSHOT.pom , ReasonPhrase:Forbidden. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Process finished with exit code 1

在cmd里面进入项目目录下,执行“mvn clean install -e”重新清理加载maven项目
参考博客

又报错:

[ERROR] Failed to execute goal on project logistics-etl: Could not resolve dependencies for project cn.it:logistics-etl:jar:1.0-SNAPSHOT: Failed to collect dependencies at cn.it.logistics.common:logistics-common:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for cn.it.logistics.common:logistics-common:jar:1.0-SNAPSHOT: Could not transfer artifact cn.it.logistics.common:logistics-common:pom:1.0-SNAPSHOT from/to mvnrepository (https://mvnrepository.com/): authorization failed for https://mvnrepository.com/cn/it/logistics/common/logistics-common/1.0-SNAPSHOT/logistics-common-1.0-SNAPSHOT.pom, status: 403 Forbidden -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project logistics-etl: Could not resolve dependencies for project cn.it:logistics-etl:jar:1.0-SNAPSHOT: Failed to collect dependencies at cn.it.logistics.common:logistics-common:jar:1.0-SNAPSHOT

在这里插入图片描述

方法二(未解决)

有博主说,如果有子项目继承父项目的情况下。在父项目下有的子项目在首次运行clean 和install前应该先运行父项目的clean和install。
install父项目的时候同样报错。
在这里插入图片描述
也是去cmd的父项目目录下执行“mvn clean install -e”重新清理加载maven项目

参考博客

同样报错:
在这里插入图片描述

方法三(已解决)

总结,估计是创建的项目是jdk17,使用的jdk是jdk8?
现在不能在idea中创建jdk8的项目了。如果想要创建jdk8的项目,解决办法:

更改URL,使用云原生URL:https://start.aliyun.com/
在这里插入图片描述
也可以直接去云原生脚手架创建项目,下载文件并解压之后,idea打开即可。
使用云原生脚手架创建maven项目。可以使用jdk8
https://start.aliyun.com/
在这里插入图片描述

idea一直默认的是使用spring创建项目
https://start.spring.io/
可以看出已经不能使用jdk8了。
在这里插入图片描述

虽然java项目dependences下面报错,红色波浪线。但是项目依旧可以执行。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值