报错:The POM for xx is missing, no dependency information available或Could not resolve dependencies

声明:仅为学习过程出现的报错,根据搜索后大致理解而得出的解决办法,仅供参考,欢迎指正交流。

背景:

写好自定义的Aliyun OSS依赖后,在测试项目的pom.xml文件下<dependences>标签导入相关依赖,测试依赖内容是否可行时出先如下报错:


问题描述

控制台指出没有依赖信息,无法解析依赖,也就是说项目识别不到自定义的本地依赖。(也可以在在maven工具栏检查下相关依赖项,发现我需要的A依赖包含的B依赖并没有出现。)


原因分析:

1.未正确配置本地maven仓库

2.本地maven仓库文件不存在自制好的依赖


解决方案:

1.在设置中检查并正确配置好本地仓库(设置->构建、执行、部署->构建工具->Maven)

 

2.回到自制的依赖项目(模块)中,在maven工具栏生命周期(Lifecycle),点击install,加入本地仓库。需要注意的是如果你有两个依赖,如果A依赖导入了B依赖,先将B依赖install再将A install。

在这之前我截了张本地Maven仓库文件夹的图可以看到并没有自定义的依赖,在这之后再看,可以看到依赖已经有了。

之前:

之后:

 然后运行测试项目,发现依赖导入进来,成功运行。

[INFO] Scanning for projects... [INFO] [INFO] ---------------< com.longshare.ta:parameter-center-run >---------------- [INFO] Building parameter-center-run 2023.7-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The POM for com.longshare.ta:parameter-center-support:jar:2023.7-SNAPSHOT is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.463 s [INFO] Finished at: 2023-07-16T21:44:34+08:00 [INFO] ------------------------------------------------------------------------ [WARNING] The requested profile "as" could not be activated because it does not exist. [ERROR] Failed to execute goal on project parameter-center-run: Could not resolve dependencies for project com.longshare.ta:parameter-center-run:jar:2023.7-SNAPSHOT: Failure to find com.longshare.ta:parameter-center-support:jar:2023.7-SNAPSHOT in https://repo.91asl.com:9443/nexus/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-public has elapsed or updates are forced -> [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
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值