2014-10-09 90 views
0

我在NetBeans中創建8.0 Maven項目,並在該項目中,打印helloworld.when我嘗試運行該項目它顯示下面的錯誤,並採取15分鐘完成添加Java類跑。畸形答覆

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 

如何解決這個問題?任何幫助將不勝感激!!!!

+0

檢查你的Maven的settings.xml - 如果它使用HTTP代理服務器設置,檢查它們是否有效 – mjn 2014-10-09 07:07:05

+0

這settings.xml中,2/settings.xml中或Maven/conf目錄/ settings.xml的? – Madhesh 2014-10-09 07:08:57

+1

你有一個SOCKS代理配置在某個不是SOCKS代理的地方。例如,它可能是一個HTTP代理。 – EJP 2014-10-09 07:09:36

回答

1

使用與NetBeans捆綁在一起的行家的nstead您的PC上安裝Maven和安裝了NetBeans參考。 然後編輯/ conf目錄/設置你的代理服務器的配置文件:

<proxies> 
    <proxy> 
    <active>true</active> 
    <host>yourproxy</host> 
    <port>8080</port> 
    </proxy> 
</proxies> 

然後把wagon-http-lightweight-2.2.jar在你的Maven/lib/ext目錄。

+1

如果您使用的是Maven 3.x,那麼最新版本的wagon-http-lightweight(http://mvnrepository.com/artifact/org.apache.maven.wagon/wagon -http-lightweight/2.10)是必要的。 – adimoldovan 2016-03-30 11:46:37