maven 依赖问题踩坑

坚强是说给别人听的谎言 提交于 2020-09-27 09:20:32
  • common子模块已经移除fastjson
  • controller模块打包的时候还是依然报错
    • Could not resolve dependencies for project com.xiaomi.mipass:mipass-stats-controller:war:0.0.1-SNAPSHOT: Failure to find com.alibaba:fastjson:jar:1.2.21 in http://xxx/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
    • 这是子模块未deploy的缘故,maven打包的时候看不到,移除操作;
    • 但是编译器idea确当做已经移除处理,所以tree dependency查不出来alibaba:fastjson:jar的依赖情况
  • 两种解决办法:
    1. deploy common子模块
    2. 在controller的pom文件中引入common子模块中加上
      • <exclusion>
            <artifactId>fastjson</artifactId>
            <groupId>com.alibaba</groupId>
        </exclusion>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!