maven简单命令无法执行,提示无法下载插件
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

dongdeng
dongdeng 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 这几个中心仓库地址都无法访问。在公司网络可以访问到以上地址,看样子要设置代理。
7 年多之前 回复

2个回答

据说可能是配置文件里的代理设置有问题

dongdeng
dongdeng 设置成正常代理可以。具体方法可以下载一个代理工具。只要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代理客户端 配置一致就可以。
7 年多之前 回复
aa1aa3
爱上一条鱼 这里的代理服务器应该是指你们公司里能用的代理吧
7 年多之前 回复
dongdeng
dongdeng [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.com8080 refused: Connection timed out: connect -> [Help 1]
7 年多之前 回复
aa1aa3
爱上一条鱼 http://licoolxue.iteye.com/blog/1427000http://stackoverflow.com/questions/1251192/how-do-i-use-maven-through-a-proxy
7 年多之前 回复

估计还是自动下载插件的时候网络有问题。。。
你那里直接访问这个网址能访问到吗

http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom

要是不行就先把.m2文件删除(或者改个其他名),再执行你那命令那MVN再重新构建下。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问