springboot通過maven下載依賴失敗解決


公司直接用不了內網遇到的好的坑。導入網上的springboot項目的啟動入口一致有報錯,如:Cannot resolve symbol 'SpringApplication'

maven配置設置都做了還是不行,但是idea下載依賴包沒有過程,看到repository中也沒有架包,經過一系列判斷找到maven的setting.xml文件要配置代理(一直以為是intellij idea里面配置),還有就是pom.xml文件需要的依賴jar如果沒有下載成功會被intellij idea標紅的。(開源項目:https://github.com/HeyJC/QRCodeLogin)

解決方法:

到的maven的安裝目錄,修改conf/settings.xml

  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
     <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>11.11.11.2</host>
      <port>8080</port>
    </proxy>
  </proxies>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM