简体   繁体   中英

Maven project can not be created in Eclipse through Proxy

在此处输入图片说明 Im using eclipse Neon and working behind a proxy. Below message boxes are displayed when im trying to create a maven project using an archetype.

"Could not resolve archetype XXXXXXXX from any of the configured repositories."

"Creating xxxxx has encountered a problem. Could not resolve archetype xxxx from any of the configured repositories"

I have configured the below settings correctly. 1. Proxy settings in Eclipse 2. Proxy settings in maven setting.xml file 3. Add the remote catalog as " http://repo1.maven.org/maven2/archetype-catalog.xml "

However, when i go to error description, it says "unexpected end of stream on connection" and it shows my proxy IP and port. Just to check, i have altered proxy IP in the setting.xml file and eclipse proxy setting but it shows the same IP and PORT in the error description without any change. I have no idea from where maven refers the proxy settings. Please advice.

Thanks in Advance

Try the following :

1) Delete your repository at C:/Users/????/.m2/repository
2) Check your C:/Users/????/.m2/settings.xml for correct proxy config
3) Set you M2_HOME environment variable to <MAVEN INSTALL DIR
4) Add %M2_HOME%/bin: to your PATH variable assuming windows (remeber to start a new window after changing ebvironment variables)
5) Try a mvn clean install from the command line - GET THIS WORKING FIRST
6) Then try from netbeans, you do not need a proxy setting it should call the default mvn.

Set proxy setting in eclipse neon as follows: Window->Preferences->General->Network Connection

Now select Active Provider as Manual .

Now you will get three proxy entries to be configured HTTP, HTTPS and SOCKS. Configure host name, port, username and password in HTTP and HTTPS proxy entries, but not in SOCKS. Try this, it may help.

Also make sure the username and password you are typing is correct.

After configuration please restart eclipse, it is required for taking the effect of configuration.

Proxy setting in .m2/settings.xml may not be required after above setting.

The same error made me struggle alot, I could download testNG and other things from eclipse marketplace, but when i'm creating a maven project i got this error. Because my internet connection is going through proxy. I tried all the above but i couldn't resolve this error, but this guy gave me the solution:

http://www.javahelps.com/2015/08/set-proxy-for-maven-in-eclipse.html

After the above procedure is done, then you have to delete the existing quickstart-archetype from below folder C:\\Users.m2\\repository\\org\\apache\\maven\\archetypes

then restart the eclipse and create a new maven project with new project name. Since this is only a proxy issue, so no need to specify the arche types and all. This should work if it's a proxy related issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM