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


    引言

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

    • 报错信息
    [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。

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

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

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

    解决方法

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

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

  • 相关阅读:
    ExtJS的定时任务(转)
    Web开发系列–GIS(转)
    Windows Mobile 6.0模拟器的浏览器中不能访问本机网址
    JS定时保存表单数据(UserData 行为)
    查询Sqlserver数据库死锁的一个存储过程(转)
    ExtJS4.0在IE9中出现了SCRIPT5007: 无法获取属性“flex”的值
    Microsoft Device Emulator 模拟器菜单 中文
    错误:网站辅助进程已被 IIS 终止(Debug 时是不是弹出)
    集成验证时IE采用Kerberos 还是NTLM验证方式?(摘抄)
    SQLServer 2005死锁终极大法(自动杀) 转
  • 原文地址:https://www.cnblogs.com/daheww/p/15750662.html
Copyright © 2020-2023  润新知