Maven Proxy Error

Hi, I can not create Maven Project on my machine. Below are my settings

Eclipse Version: Mars.1 Release (4.5.1) Maven Version: m2e, Maven Integration for Eclipse, 1.6.2 

I am behind the corporate proxy. I tried to configure the settings file inside the .m2 directory and it does not work. Below is my settings file

 <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <proxies> <proxy> <id>myproxy</id> <active>true</active> <protocol>http</protocol> <host>XX.XX.XX.XX</host> <port>8080</port> <nonProxyHosts></nonProxyHosts> <username>USERNAME</username> <password>PASSWORD</password> </proxy> </proxies> </settings> 

I saw a lot of answers in StackOverflow regarding this problem, I tried and nothing works. I doubt that there is a “@” in my PASSWORD, does this cause any problems? Also, do we need to provide USERNAME as the domain \ USERNAME or only USERNAME? And how to provide both http and https in the file?

Stack trace error

 Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories. Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): connect timed out 
+1
source share
3 answers

In my experience.

  • The @ symbol is not a major issue. Since my pwd also includes this character.
  • No domain required
  • In fact, perhaps you can try this way:

Configure proxy information in your IDE (ex: eclipse) instead of config in settgins.xml, which means deleting the entire configuration in the maven settings file

0
source

Just change the maven setting which solves the problem

  • Download maven binaries and extract it and set the appropriate path variable.

  • check the command line or terminal by typing mvn to make it work!

  • edit settings.xml inside the extracted conf conf directory.

  • go to windows -> preferences -> maven settings -> Installtions

  • add a new installation with the correct path to the extracted maven binary folder.

that is, you will no longer run into any problem!

0
source

In my case, I just took the following steps and worked.

  • Mentioned proxy details in eclipse and maven (/user/.m2/settings.xml)
  • Then removed all * .lastupdated files from /user/.m2/repository
  • Subsequently it worked perfectly
0
source

Source: https://habr.com/ru/post/1494405/


All Articles