解决:Could not resolve dependencies for project xxx: Could not find artifact xxx

引言

运行A module,找不到B module的依赖报错。A、B module都在project中。

解决:Could not resolve dependencies for project xxx: Could not find artifact xxx解决:Could not resolve dependencies for project xxx: Could not find artifact xxx
  • 报错信息
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< com.totainfo.schedulingsystem:aps >------------------
[INFO] Building aps 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.totainfo.schedulingsystem.strategy:aps-strategy-schedule-wip:jar:0.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.872 s
[INFO] Finished at: 2021-12-30T20:55:47+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project aps: Could not resolve dependencies for project com.totainfo.schedulingsystem:aps:jar:0.0.1-SNAPSHOT: Could not find artifact com.totainfo.schedulingsystem.strategy:aps-strategy-schedule-wip:jar:0.0.1-SNAPSHOT -> [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

原因分析

我之前通过设置,将代码的build工作委托给了maven。

解决:Could not resolve dependencies for project xxx: Could not find artifact xxx

所以我点击运行的时候,idea不会使用自带的build功能进行build,而是使用maven进行build。

解决:Could not resolve dependencies for project xxx: Could not find artifact xxx

而点开看运行配置会发现,启动前的行为Build

解决:Could not resolve dependencies for project xxx: Could not find artifact xxx

查看log可知maven只会build当前module,所以其它module的依赖找不到。

解决:Could not resolve dependencies for project xxx: Could not find artifact xxx

解决方法

修改运行配置,运行前Build Project

解决:Could not resolve dependencies for project xxx: Could not find artifact xxx

点击运行,可以从log中看到maven将其它module也build了,问题解决。

解决:Could not resolve dependencies for project xxx: Could not find artifact xxx
上一篇:大数据学习(31)—— flink流处理


下一篇:mongodb Install the MongoDB service