报错: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] -------------------------< cn.surveyking:api >-------------------------- [INFO] Building api v1.8.2 [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The POM for cn.surveyking:shared:jar:v1.8.2 is missing, no dependency information available [WARNING] The POM for cn.surveyking:rdbms:jar:v1.8.2 is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.421 s [INFO] Finished at: 2025-04-01T17:41:09+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project api: Could not resolve dependencies for project cn.surveyking:api:jar:v1.8.2: The following artifacts could not be resolved: cn.surveyking:shared:jar:v1.8.2, cn.surveyking:rdbms:jar:v1.8.2: Failure to find cn.surveyking:shared:jar:v1.8.2 in http://maven.aliyun.com/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus-aliyun 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
04-02
运行generator代码生成器的时候出现了下方提示:"C:\Program Files\Java\jdk-21.0.3\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\Idea\IdeaProjects\train\generator -Djansi.passthrough=true "-Dmaven.home=D:\Idea\IntelliJ IDEA 2024.3.1.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\Idea\IntelliJ IDEA 2024.3.1.1\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=D:\Idea\IntelliJ IDEA 2024.3.1.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\Idea\IntelliJ IDEA 2024.3.1.1\lib\idea_rt.jar=56501:D:\Idea\IntelliJ IDEA 2024.3.1.1\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath "D:\Idea\IntelliJ IDEA 2024.3.1.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.8.0.jar;D:\Idea\IntelliJ IDEA 2024.3.1.1\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2024.3.1.1 org.mybatis.generator:mybatis-generator-maven-plugin:1.4.0:generate [INFO] Scanning for projects... [INFO] [INFO] -------------------------< com.jjk:generator >-------------------------- [INFO] Building generator 0.0.1-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The POM for com.jjk:train-member:jar:0.0.1-SNAPSHOT is missing, no dependency information available [WARNING] The POM for com.jjk:train-business:jar:0.0.1-SNAPSHOT is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.420 s [INFO] Finished at: 2025-03-28T14:17:57+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project generator: Could not resolve dependencies for project com.jjk:generator:jar:0.0.1-SNAPSHOT [ERROR] dependency: com.jjk:train-member:jar:0.0.1-SNAPSHOT (compile) [ERROR] Could not find artifact
03-29
[INFO] Scanning for projects... [INFO] [INFO] ----------------------< com.example:pet-boarding >---------------------- [INFO] Building pet-boarding 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The POM for mysql:mysql-connector-java:jar:8.1.0 is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.847 s [INFO] Finished at: 2025-05-07T16:15:00+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project pet-boarding: Could not resolve dependencies for project com.example:pet-boarding:jar:1.0-SNAPSHOT [ERROR] dependency: mysql:mysql-connector-java:jar:8.1.0 (runtime) [ERROR] mysql:mysql-connector-java:jar:8.1.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced [ERROR] [ERROR] -> [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
最新发布
05-08
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: cn.dev33:sa-token-dao-redis-jackson:jar -> duplicate declaration of version 1.33.0 @ com.jian:ji_an_riding_master:1.0.0-SNAPSHOT, D:\develop\TaiYangGongShe_v2\ji_an_riding_master\pom.xml, line 205, column 25 [WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.alibaba:easyexcel:jar -> version 3.1.1 vs 3.0.5 @ com.jian:ji_an_riding_master:1.0.0-SNAPSHOT, D:\develop\TaiYangGongShe_v2\ji_an_riding_master\pom.xml, line 211, column 25 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] --------------------------< com.jian:manage >--------------------------- [INFO] Building 后端管理模块 1.0.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The POM for com.jian:service:jar:1.0.0-SNAPSHOT is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.484 s [INFO] Finished at: 2025-03-24T16:19:02+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project manage: Could not resolve dependencies for project com.jian:manage:jar:1.0.0-SNAPSHOT [ERROR] dependency: com.jian:service:jar:1.0.0-SNAPSHOT (compile) [ERROR] Could not find artifact com.jian:service:jar:1.0.0-SNAPSHOT [ERROR] [ERROR] -> [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 m
03-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值