Maven Connect Timeout from/to Central “https://repo.maven.apache.org/maven2”

Maven Connect Timeout from/to Central “https://repo.maven.apache.org/maven2” happen when you are in VPN and proxy network where your office firewall not allowing to download from outside network.

CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out

Solution  1:

  • Try  after exiting  from VPN Network so that your office firewall not stop you to download dependencies.

Solution 2:

  • Update your firewall proxy settings in ./m2/settings.xml or /maven directory/conf/settings.xml file as below
 <proxies>
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>your.proxy.host</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>

  </proxies>

  • Add same file in your eclipse as below Window -> Preference-> Maven -> User Settings
    maven settings.xml path

Click on Apply and then OK.

  • Go to your project -> Right Click ->Maven ->Update Project -> Check Force Update -> Click on OK

Hope that will fix your issue .

Leave you feedback to enhance more on this topic so that make it more helpful for others.

 

Advertisements

This site uses Akismet to reduce spam. Learn how your comment data is processed.