无法创建Maven项目 [英] cannot create maven project

查看:112
本文介绍了无法创建Maven项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建Maven项目,但失败了.我在网络中使用代理.我可以在浏览器中访问" https://repo.maven.apache.org/maven2 " .错误显示:

I want to create maven project but failed. I use proxy in my network. I can reach "https://repo.maven.apache.org/maven2" in browser. the error show:

无法解析原型 org.apache.maven.archetypes:maven-archetype-webapp:1.0中的任何一个 配置的存储库.无法解决工件 org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0无法 转移神器 org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to 中央( https://repo.maven.apache.org/maven2 ):连接超时 无法传输工件 org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to 中央( https://repo.maven.apache.org/maven2 ):连接超时

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories. Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): Connect timed out Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): Connect timed out

我已经创建了setting.xml并放入了.m2文件夹. setting.xml包含:

I already create setting.xml and put to .m2 folder. the setting.xml contains:

<proxies>
    <proxy>
      <id>myproxy</id>  
      <active>true</active>
      <protocol>http</protocol>
      <host>idnproxy.myproxy.asia</host>
      <port>8080</port>
      <username>c76266</username>
      <password>Password09</password>
      <nonProxyHosts>localhost|128.*.*.*|10.*.*.*|*.intranet.asia|*.group.local</nonProxyHosts>
    </proxy>
  </proxies>

此设置代理,端口,用户名和密码与浏览器中的设置相同,并且我可以运行互联网.我认为配置是正确的.如何解决这个问题?谢谢.

this setting proxy, port, username and password same with setting in my browser and I can running internet. I assume that configuration is true. how to fix this problem? thanks.

推荐答案

应为settings.xml,而不是setting.xml

It should be settings.xml , not setting.xml

或者,如果您确实要使用此setting.xml,请从命令行将maven指向此xml文件

Or if you do want to use this setting.xml , from command line, point maven to this xml file

mvn -s Full_PATH_TO_setting.xml install

这篇关于无法创建Maven项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆