Maven Pom.xml issue

ぐ巨炮叔叔 提交于 2019-12-04 03:21:44

Sounds like you need to set up a maven proxy in your settings.xml.

Have a look (for example) in your web browser and see how it is set up.

From the documentation on Configuring a proxy:

<proxy>
  <active>true</active>
  <protocol>http</protocol>
  <host>proxy.somewhere.com</host>
  <port>8080</port>
  <username>proxyuser</username>
  <password>somepassword</password>
  <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
</proxy>
berhauz

I fixed a similar problem (i.e. Could not transfer artifact... connection refused...) in my case by fixing the repositories. Actually, I added the release repo where only the milestone one was present and refused connections. Sugg.: check which repo are needed and/or copy them from a POM without the issue.

<repositories>
    <repository>
        <id>repo.springsource.org.milestone</id>
        <name>Spring Framework Maven Milestone Repository</name>
        <url>https://repo.springsource.org/milestone</url>
    </repository>
    <repository> <!-- this one added -->
        <id>repository.springframework.maven.release</id>
        <name>Spring Framework Maven Release Repository</name>
        <url>http://maven.springframework.org/release</url>
    </repository>
</repositories>
<proxy>
  <id>myproxy</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>chenchu.madhiboina</username>  <!-- LOG in username/Put your username here -->
  <password>hari01</password>  <!-- LOG in password/Put your password here -->
  <host>xx.xx.xx.xx</host>   <!-- Put the IP address of your proxy server here -->
  <port>80</port>            <!-- Put your proxy server's port number here -->
  <nonProxyHosts>local.net|some.host.com</nonProxyHosts> <!-- Do not use this setting unless you know what you're doing. -->
</proxy>    

This error is because you are behind the proxy and maven couldnot download few jars required. In office network I was getting the same error. Then I tried in home wifi and the error was no more. I didnt change setting.xml just followed below steps 1. Connect to network which doesnot have any proxy or firewall 2. Right click on the project-->maven-->Update project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!