將一個新項目打包爲 Jar 上線時發生了這個錯誤
Failed to execute goal on project mayimq-client: Could not resolve dependencies for project cn.wangchunlong:mayimq-client:jar:1.0: The following artifacts could not be resolved: cn.wangchunlong:mayimq-utils:jar:1.0, cn.wangchunlong:mayimq-remoting:jar:1.0: Could not find artifact cn.wangchunlong:mayimq-utils:jar:1.0 in spring-snapshots (https://repo.spring.io/snapshot) -> [Help 1]
這是因爲我項目有個地方引用了本地的幾個依賴包,而依賴包沒有通過maven編譯的原因,找到那幾個依賴包的項目,使用maven打包命令導包,命令是 mvn install ,
如果使用Eclipse 可以直接項目右鍵 ---》Run As ----》maven install就可以了,
如果是 IDEA 在 Terminal 控制欄中輸入 mvn install 輸入命令進行手動打包
操作完上述過程後到你所需要打包的項目重新打包就行了,對了,如果要打成 Jar 包的話必須是 使用的是JDK,而不能是 JRE