2011-04-18 104 views
22

我已经下载了最新的行家在5分钟内不工作

行家3.0.3,Java版本 “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 \应用\ 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> 

什么我在这里面临的问题?为什么不下载?

+1

尼斯问题所提供的所有相关信息。请将您的解决方案也作为答案添加并接受,让其他有此问题的人更容易找到答案。 – 2011-04-18 19:56:06

+0

对于所有那些仍然需要一个轮廓:http://maven.apache.org/guides/mini/guide-proxies.html。 – 2013-05-09 16:55:54

回答

41

找到解决方案:

解决方案#1:

问题是在settings.xml文件代理:

<host>webproxy</host> 

获得主机转到IE->工具 - >连接 - >局域网设置 - >高级 - > http。

=====

溶液#2:

如果自动配置的代理给出:然后

1>打开IE(或任何浏览器)

2>从IE浏览器 - >工具 - >互联网选项 - >连接 - >局域网设置 - >获取地址,并在URL中给出例如:从http://autocache.abc.com/并输入文件将的.pac格式下载,保存到桌面

3>在textpad打开.pac文件识别代理:

在你的编辑器,它会是这样的:

return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080"; 

4>去的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:通过命令提示安装或通过蚀运行。

=====

解决方案3:

对于任何其他问题,删除本地Maven的资源库和运行MVN:重新安装

+3

还要取消的代理标签 – wasaykhan 2011-11-19 20:28:19

+0

方案#2的工作就像一个魅力.. – Achow 2012-12-13 08:22:57

1

很明显,这是一个代理问题。在setting.xml中使用VPN或编辑实体设置。 我搜索了很多关于这个错误。最后,我使用VPN(虚拟专用网络)来禁用代理,并能够使用Maven的cemtral存储库。

0

尝试在位于以下目录中settings.xml文件检查代理服务器设置:

C:\ Users \用户名\ .m2目录

0

我只是复制Setting.xml的其中谈到下的“\ Apache的maven- 3.1.1 \ CONF”目录,以目录‘$ {}的user.home /。平方米/)’窗机,并更改所需的代理根据下面我的网络设置,它为我工作。

<proxy> 
    <id>optional</id> 
    <active>true</active> 
    <protocol>http</protocol> 
    <host>www-proxy.xxxx</host> 
    <port>8080</port> 
</proxy> 

谢谢 - 卡姆兰沙赫扎德

1

窗口 - 首选项 - Maven的用户设置。检查settings.xml是否存在?如果eclipse说不,从你的朋友那里获取settings.xml,或者设置它的路径。

+0

改变答案格式 – SGG 2014-05-29 10:04:58

0

我们观察到,当maven项目尝试从该URL下载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> Internet选项>连接[TAB]> LAN设置>下LAN>高级代理服务器检查使用代理服务器>选中“对所有协议相同的代理服务器”,然后单击确定。

0

下面添加Settings.XML中下代理标签为我工作

<proxy> 
    <id>optional</id> 
    <active>true</active> 
    <protocol>https</protocol>   
    <host>web-proxy.ind.abc.com</host> 
    <port>8080</port> 
</proxy>