我已下载最新的
maven 3.0.3,java version“1.6.0_18”。
mvn -version
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: C:\software\apache-maven-3.0.3
Java version: 1.5.0_05, vendor: Sun Microsystems Inc.
Java home: C:\software\jdk1.5.0.15\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
我的应用程序位于:C:\ Temp \ ecm_esv \ app \ ENT_APP \ ESV>。我收到以下错误消息:
C:\Temp\ecm_esv\app\ENT_APP\ESV>mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.5/maven-deploy-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.5: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.5
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:2.0.1: Plugin org.apache.maven.plugins:maven-site-plugin:2.0.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:2.0.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.0
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.406s
[INFO] Finished at: Mon Apr 18 15:51:05 CEST 2011
[INFO] Final Memory: 1M/3M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Temp\ecm_esv\app\ENT_APP\ESV), central (http://repo1.maven.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
C:\Temp\ecm_esv\app\ENT_APP\ESV>
C:\ SOFTWARE \ Apache的行家-3.0.3 \ CONF \的settings.xml 我在这里启用了代理:
….
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|-->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>www.BT.co.uk</host>
<port>80</port>
<nonProxyHosts>localhost|google.com</nonProxyHosts>
</proxy>
</proxies>
我面临的问题是什么?为什么不下载?
答案 0 :(得分:42)
找到解决方案:
解决方案#1:
问题在于settings.xml文件中的代理:
<host>webproxy</host>
获取主机goto IE-&gt; tools-&gt; connection-&gt; LAN settings-&gt; advanced-&gt; http。
=====
解决方案#2:
如果给出了自动配置的代理:那么
1&GT;打开IE(或任何浏览器)
2 - ;通过IE->工具 - >网络选项 - >连接 - >局域网设置 - &gt;从您的浏览器获取网址获取地址并输入网址,例如: http://autocache.abc.com/ 并输入,将以.pac格式下载文件,保存到桌面
3&GT;在textpad中打开.pac文件,识别PROXY:
在你的编辑器中,它会像:
return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080";
4&GT;转到Maven settings.xml并输入:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
</proxy>
5个通过命令提示符运行 mvn:install 或运行eclipse。
=====
解决方案#3:
对于任何其他问题,请删除maven本地存储库并再次运行 mvn:install 。
答案 1 :(得分:1)
显然这是一个代理问题。在settings.xml中使用VPN或编辑procy设置。 我搜索了很多关于这个错误。最后,我使用VPN(虚拟专用网络)来禁用代理,并且能够使用Maven的cemtral存储库。
答案 2 :(得分:1)
Window-Preferences-Maven-用户设置。检查,settings.xml是否存在?如果eclipse说不,请从你的朋友那里获取settings.xml或设置它的路径。
答案 3 :(得分:0)
尝试检查位于以下目录下的settings.xml文件中的代理设置:
C:\ Users \用户名\ .m2目录
答案 4 :(得分:0)
我刚刚将“\ apache-maven-3.1.1 \ conf”目录下的setting.xml复制到windows机器目录“$ {user.home} /.m2 /)”并更改了所需的代理根据我的网络设置如下,它对我有用。
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>www-proxy.xxxx</host>
<port>8080</port>
</proxy>
谢谢 - Kamran Shahzad
答案 5 :(得分:0)
我们发现maven项目创建在尝试从此网址下载archtype时失败:Maven Repository属于“https”协议。
因此,上述解决方案#2仅在对 settings.xml 进行一些更改后才起作用。我不必使用“http”协议,而是使用“https”
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
希望它有所帮助。
注意:请务必检查以下互联网设置。
Internet Explorer&gt;互联网选项&gt;连接[TAB]&gt; LAN设置&gt;在代理服务器下检查使用代理服务器进行LAN&gt;高级&gt;选中“所有协议的相同代理服务器”,然后单击“确定”。
答案 6 :(得分:0)
在settings.xml中的proxy标签下面添加为我工作
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
</proxy>