Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap

Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap问题描述:使用Eclipse自带的Maven插件创建Web项目时报错:Couldnotresolvearchetypeorg.apache.maven.archetypes:maven-archetype-webapp:RELEASEfromanyoftheconfiguredrepositories.Couldnotresolveartifa

大家好,又见面了,我是你们的朋友全栈君。

问题描述:

        使用Eclipse自带的Maven插件创建Web项目时报错:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\liujunguang\.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\liujunguang\.m2\repository)

错误如图:

Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap

Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap

 

解决方案:

1. 在Eclipse Maven配置中添加新的Catalog配置:

 

2. 也可以下载到本地,然后再添加,这样比较快(推荐)

 
     如图:
Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap

 

 

接下来在使用刚添加的catalog创建web工程

      Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap

    这个时候就可以看到Eclipse联网下载了:

     Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap
这个时候看一下是不是创建成功了

 

如果还是不能创建或者问题没有解决可以安装下面的方法:

1.删除maven已经下载的文件路径:.m2\repository\org\apache\maven

删除之后再试下,这时候如果看到有进度,只需要耐心等待就行了

 

2.Maven下载jar慢可以使用国内阿里镜像

具体配置文件(settings.xml)如下,放在.m2文件夹下,.m2一般位于用户目录下

打开 maven 的配置文件( windows 机器一般在 maven 安装目录的 conf/settings.xml ),在<mirrors></mirrors>标签中添加 mirror 子节点:

<mirror>
  <id>aliyunmaven</id>
  <mirrorOf>*</mirrorOf>
  <name>阿里云公共仓库</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

如果想使用其它代理仓库,可在<repositories></repositories>节点中加入对应的仓库使用地址。以使用 spring 代理仓为例:

<repository>
  <id>spring</id>
  <url>https://maven.aliyun.com/repository/spring</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

参考文档:https://maven.aliyun.com/mvn/guide

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/161994.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • sdfsfd

    sdfsfd

    2021年11月14日
    35
  • ubuntu18.04录屏软件_linux录屏软件推荐

    ubuntu18.04录屏软件_linux录屏软件推荐1安装1sudoadd-apt-repositoryppa:peek-developers/stablesudoaptupdatesudoaptinstallpeek2.peek使用我想使用peek录制我操作某一软件,做一个教程。发现选不中要录的软件,因为peek始终在最前端,你只能选用peek,咋么办?将peek放置要录的区域,选择录制,出现倒计时在倒计时这几秒内,右键peek顶部,取消Alwayontop在桌面的菜单栏,选择软件,这时,这个软件处于最前端,然

    2022年9月15日
    0
  • phpstorm激活码2021.5【注册码】[通俗易懂]

    phpstorm激活码2021.5【注册码】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月20日
    47
  • FinalShell简单的使用

    FinalShell简单的使用今天真的是很丧的一天,早上来到公司写了一会代码,需要用xshell时发现,以前都能打开的xshell突然出问题了。如下截图…于是想着重启看看。我的天,重启之后,网卡没了,接着就是死活连不上网,不管设置什么都连接不上网,驱动也装不上去,反正就是十八般武艺全用上了(博主可能比较菜),都没作用,于是请人,反正弄了半天,给我放个大招,重装系统 。重装系统肯定就好了,可是环境都没了,开始一点…

    2022年6月13日
    81
  • javascript超强幻灯片代码

    javascript超强幻灯片代码javascript超强幻灯片代码[code]#f_div{    width:150px;    height:100px;    overflow:hidden;    margin-top:0;    margin-right:auto;    margin-bottom:0;    margin-left:0px;}#f_

    2022年7月13日
    14
  • 安卓性能调优:内存使用分析和方法调用优化

    安卓性能调优:内存使用分析和方法调用优化

    2021年8月27日
    44

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号