【发布时间】:2023-04-07 14:41:01
【问题描述】:
我在 netbeans 8.0 中创建了 maven 项目,并在该项目中添加了 java 类以打印 helloworld。当我尝试运行该项目时,它显示以下错误并需要 15 分钟才能完成运行。
cd C:\Users\selva\Documents\NetBeansProjects\SelvaMaven; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_05" cmd /c "\"\"C:\\Program Files\\NetBeans 8.0\\java\\maven\\bin\\mvn.bat\" -Dexec.args=\"-classpath %classpath com.mycompany.selvamaven.SelDur\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_05\\bin\\java.exe\" -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.0\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=true process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.pom
Oct 09, 2014 12:11:04 PM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Malformed reply from SOCKS server
Oct 09, 2014 12:11:05 PM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: Retrying connect
Oct 09, 2014 12:16:05 PM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Malformed reply from SOCKS server
Oct 09, 2014 12:16:05 PM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: Retrying connect
Oct 09, 2014 12:21:06 PM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Malformed reply from SOCKS server
Oct 09, 2014 12:21:06 PM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: Retrying connect
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 20:02.044s
Finished at: Thu Oct 09 12:26:06 IST 2014
Final Memory: 4M/99M
------------------------------------------------------------------------
Plugin org.codehaus.mojo:exec-maven-plugin:1.2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.2.1: Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.2.1 from/to central (http://repo.maven.apache.org/maven2): Malformed reply from SOCKS server -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
如何解决这个问题?任何帮助将不胜感激!!!!
【问题讨论】:
-
检查您的 Maven settings.xml - 如果它使用 HTTP 代理设置,请检查它们是否有效
-
哪个 settings.xml、m2/settings.xml 或 maven/conf/settings.xml?
-
您在某处配置了一个不是 SOCKS 代理的 SOCKS 代理。例如,它可能是一个 HTTP 代理。
-
我的项目、ide 和系统中没有配置 socks 代理。
-
如果你没有在某处配置 SOCKS 代理,你不可能得到这个错误。你可能不知道它在哪里,或者你自己做过,但它就在某个地方。