依賴兄弟模塊時,執行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就可以了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章