6

Current WinHTTP proxy settings: Direct access (no proxy server) in windows machine. And in settings.xml as . But, jars are not getting downloaded and getting below error.

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor fo

r org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.24.215] failed: Connection timed out: con nect -> [Help 1]

1
  • Can you ping the repo server?
    – Michael-O
    Commented Jul 15, 2016 at 23:03

2 Answers 2

17

As per maven documentation we have to add some settings.xml with setting in it mentioned here Guide to proxies .

<settings>
   <proxies>
      <proxy>
        <id>example-proxy</id>
        <active>true</active>
        <protocol>http</protocol>
        <host>proxy.example.com</host>
        <port>8080</port>
        <username>proxyuser</username>
        <password>somepassword</password>
        <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
      </proxy>
   </proxies>
   .
   .
</settings>

Another way to do download dependencies quickly is as follows

mvn clean install -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=YourPort 

the second one works fine for me. Hope atleast one of above solution will work for you hoping your network doesn't have any blocked servers from maven repo.

2
  • Worked after adding proxy details in settings.xml. Thanks
    – Pand005
    Commented Jul 19, 2016 at 12:25
  • how to set proxy for org.scalatest for this dependency Commented Nov 19, 2018 at 14:43
-1

If you have a antivirus installed in your machine then simply disable that to 10 mins and try to do mvn clean install . All the dependecy from maven repo will download .

This worked for me . Thanks !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.