Maven 2 maven在5分钟内不工作

Maven 2 maven在5分钟内不工作,maven-2,maven,Maven 2,Maven,我已经下载了最新的 maven 3.0.3,java版本“1.6.0_18” mvn–版本 我的应用程序位于:C:\Temp\ecm\u esv\app\ENT\u app\esv>。我收到以下错误消息: C:\Temp\ecm_esv\app\ENT_APP\ESV>mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-qui

我已经下载了最新的

maven 3.0.3,java版本“1.6.0_18”

mvn–版本

我的应用程序位于:C:\Temp\ecm\u esv\app\ENT\u 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-maven-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>
…。
可选择的
真的
http
www.BT.co.uk
80
localhost | google.com
我现在面临的问题是什么?为什么不下载

找到解决方案:

解决方案#1:

settings.xml文件中的代理存在问题:

<host>webproxy</host>
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>

可选择的
真的
http
web-proxy.ind.abc.com
8080
5> 运行mvn:通过命令提示符安装或通过eclipse运行

=====

解决方案#3:


对于任何其他问题,请删除maven本地存储库并再次运行mvn:install

显然这是代理问题。使用VPN或在setting.xml中编辑进程设置。
关于这个错误我查了很多。最后,我使用VPN(虚拟专用网络)禁用代理,并能够使用Maven的cemtral repository。

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


C:\Users\UserName\.m2

我刚刚将“\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>

可选择的
真的
http
www-proxy.xxxx
8080
谢谢--
Kamran Shahzad

窗口首选项Maven用户设置。检查,settings.xml是否存在?如果eclipse拒绝,请从您的朋友处获取settings.xml或设置指向它的路径。

我们观察到,maven项目创建在尝试从此URL下载archtype时失败:该URL属于“https”协议

因此,上面提到的解决方案#2只有在对settings.xml稍作更改后才起作用。除了使用“http”协议,我还必须使用“https”


可选择的
真的
https
web-proxy.ind.abc.com
8080

希望它能帮助别人

注意:请确保检查以下internet设置


Internet Explorer>Internet选项>连接[选项卡]>局域网设置>在代理服务器下检查使用局域网代理服务器>高级>检查“所有协议使用相同的代理服务器”,然后单击确定。

在Settings.xml中的代理标记下添加以下内容对我有效

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

可选择的
真的
https
web-proxy.ind.abc.com
8080

问题很好,提供了所有相关信息。请将您的解决方案也添加为答案并接受,以便有此问题的其他人更容易找到它。对于所有仍需要大纲的人:。还请取消对代理标记的注释
<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <host>www-proxy.xxxx</host>
  <port>8080</port>
</proxy>
<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>https</protocol>          
  <host>web-proxy.ind.abc.com</host>
  <port>8080</port>          
<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>https</protocol>          
  <host>web-proxy.ind.abc.com</host>
  <port>8080</port>  
</proxy>