依赖兄弟模块时,执行mvn命令报错:找不到依赖

有个项目是多模块的,模块A,模块B。模块A和B是同一个父pom下的兄弟模块。模块B依赖模块A,但是模块A又不需要部署到maven仓库。当执行mvn dependency:tree的时候就会报下面的错误:

Could not resolve dependencies for project **moduleA**: The following artifacts could 
not be resolved: moduleA: Failure to find **moduleA 1.0.0**  in /nexus/content/groups/public/ was 
cached in the local repository,resolution will not be reattempted until 
the update interval of public has elapsed or updates are forced .

解决方法就是:先在父pom的目录下,执行mvn install。然后在到子目录执行mvn dependency:tree就可以了。

猜你喜欢

转载自blog.csdn.net/liang0000zai/article/details/84588492