Maven項目報錯:Cannot access nexus-aliyun (http://maven.aliyun.com/nexus/content/...) in offline mode

一、問題描述

Maven項目使用idea打開後,無論如何都無法導入pom裏面的依賴,點擊reimport就瞬間結束。

 
然後,install項目會報以下錯誤,很是奇葩。
 
即:

[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Cannot access nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public) in offline mode and the artifact org.apache.maven.plugins:maven-install-plugin:jar:2.4 has not been downloaded from it before. -> [Help 1]

二、問題原因

報錯清晰說明了,是因爲依賴都無法下載。而導致依賴無法下載的原因,是因爲項目被設置爲offline mode。因爲項目是拷貝過來的,所以,不知道之前是怎麼回事,真是很坑。

三、解決辦法

知道問題原因,解決辦法,就是設置maven配置取消offline mode.
File-》Settings-》Build,Execution,Deployment-》Build Tools-》Maven-》取消Work offline


四、參考:

1.https://blog.csdn.net/doudou0809/article/details/80345789
 

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