maven简单命令无法执行,提示无法下载插件

2019-03-25 13:35|来源: 网路

D:\Work\testartifct>mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mymaven 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.663s
[INFO] Finished at: Thu Jul 05 22:50:42 CST 2012
[INFO] Final Memory: 2M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its d
ependencies could not be resolved: Failed to read artifact descriptor for org.ap
ache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org
.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.
maven.apache.org/maven2): Connection to http://repo.maven.apache.org refused: Co
nnection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException


问题补充:本机可以直接上网,另外本机使用MAVEN2.2.1 和 3.0.4 都是这个情况。

问题补充:http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
http://repo1.maven.apache.org/maven2/org/apache/maven/plugins/maven-
clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
http://repo2.maven.apache.org/maven2/org/apache/maven/plugins/maven-
clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
这几个中心仓库地址都无法访问。在公司网络可以访问到以上地址,看样子要设置代理。

现在设置的代理服务器不能连接
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its d
ependencies could not be resolved: Failed to read artifact descriptor for org.ap
ache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org
.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.
maven.apache.org/maven2): Connection to http://proxy.somewhere.com:8080 refused:
Connection timed out: connect -> [Help 1]

还有别的代理服务器吗???

问题补充:问题成功解决:
设置成正常代理可以。具体方法可以下载一个代理工具。只要IE配置成能直接访问http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom  表示能正常下载了。
配置
<proxy>    
<active>true</active>
<protocol>http</protocol>
<host>127.0.0.1</host>
<port>8282</port>
<nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
    </proxy>
关键的
<host>127.0.0.1</host>
<port>8282</port>
只要与你的ie代理客户端 配置一致就可以。

相关问答

更多