今天学习maven,在控制台下新建maven项目没有问题,但是在STS(eclipse)下创建maven项目老是报错,郁闷死了:

----------------------------------------------------

错误信息:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories.
Could not resolve artifact
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 (F:\maven\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 (F:\maven\repository)

----------------------------------------------------

遇到问题,就是baidu/google查找解决方法,可惜网上很多人提到的方法试了都不行,郁闷了好几个小时,最后找到问题原因如下:

以上报错的原因是:在settings.xml 文件中 mirrors出了问题。默认maven3.1.0安装目录下的conf目录下的setting.xml配置文件中的mirrors配置是这样的:

  1. <mirrors>
  2. <!-- mirror
  3. | Specifies a repository mirror site to use instead of a given repository. The repository that
  4. | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
  5. | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
  6. |
  7. <mirror>
  8. <id>mirrorId</id>
  9. <mirrorOf>repositoryId</mirrorOf>
  10. <name>Human Readable Name for this Mirror.</name>
  11. <url>http://my.repository.com/repo/path</url>
  12. </mirror>
  13. -->
  14. </mirrors>
  <mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
</mirrors>

我也不是很清楚为什么就是不行(猜测是maven默认的internet仓库里的文件不全,所以就添加了大家用得最多的maven的internet仓库之一:lbiblio,基本所有的开源的框架的jar文件都有提供),然后在setting.xml配置文件上面我添加了一个新的mirror,添加后如下:

  1. <mirrors>
  2. <!-- mirror
  3. | Specifies a repository mirror site to use instead of a given repository. The repository that
  4. | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
  5. | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
  6. |
  7. <mirror>
  8. <id>mirrorId</id>
  9. <mirrorOf>repositoryId</mirrorOf>
  10. <name>Human Readable Name for this Mirror.</name>
  11. <url>http://my.repository.com/repo/path</url>
  12. </mirror>
  13. -->
  14. <!--以下是新增加上去的-->
  15. <mirror>
  16. <id>ibiblio.org</id>
  17. <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
  18. <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
  19. <mirrorOf>central</mirrorOf>
  20. </mirror>
  21. </mirrors>
  <mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<!--以下是新增加上去的-->
<mirror>
<id>ibiblio.org</id>
<name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror> </mirrors>

就只是修改了setting.xml配置文件上的这个地方,然后在控制台下我重新输入:

mvn help:system

回车,就可以看到重新下载了好多的jar包文件。

等下载完成后,再在eclipse新建maven项目就正常了。

Maven报错:maven-archetype-webapp:RELEASE from any of the configured repositories的更多相关文章

  1. Eclipse使用Maven创建普通Java工程时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.

    报错信息如下: Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE f ...

  2. springboot maven 报错ArtifactDescriptorException

    maven具体报错提示如下: Description Resource Path Location TypeArtifactDescriptorException: Failed to read ar ...

  3. maven报错非法字符:\65279 错误

    开发中一个项目很早就报这个错,maven报错非法字符:\65279 错误,今天终于忍无可忍要解决它 :编译java文件的时候,有些java文件报非法字符 \65279错误,在网上找和很多 方法,也试了 ...

  4. 转:maven报错非法字符:\65279 错误

    开发中一个项目很早就报这个错,maven报错非法字符:\65279 错误,今天终于忍无可忍要解决它 :编译java文件的时候,有些java文件报非法字符 \65279错误,在网上找和很多 方法,也试了 ...

  5. [转]解决Maven报错"Plugin execution not covered by lifecycle configuration"

    [转]解决Maven报错"Plugin execution not covered by lifecycle configuration" 导入Myabtis源码后,POM文件会报 ...

  6. Maven报错Archive for required library:某.jar' in project '项目名'

    Maven报错Archive for required library:某.jar' in project '项目名'cannot be read or is not a valid ZIP file ...

  7. Maven 报错:Compilation of Maven projects is supported only if external build is started from an IDE.

    Maven 报错: Error:Maven Resources Compiler: Maven project configuration required for module 'yourProje ...

  8. Maven报错: Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp

    郁闷了两天,创建maven项目时,eclipse报错:Could not resolve artifact org.apache.maven.archetypes:maven-archetype-we ...

  9. 关于Maven报错的一些解决办法(别处贴的)

    1.警告:The tag handler class for "s:form"(org.apache.struts2.views.jsp.ui.FormTag) was not f ...

随机推荐

  1. nginx停止

  2. eCharts IE8兼容性问题

    使用Echart的图表柱状图,里面用了Float32Array,IE8下面会提示无法找到Float32Array,黄色叹号. 网上查找后使用如下方法解决:不明觉厉 在<head></ ...

  3. LESS+to+MCSS

    此文已由作者郑海波授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验 一.前言 虽然首页没有开始做,昨天仍决定将[MCSS](https://github.com/NetEaseW ...

  4. django系列1--介绍与简单原理, wsgiref模块

    一.web应用框架 Web应用框架(Web application framework)是一种计算机软件框架,用来支持动态网站.网络应用程序及网络服务的开发.这种框架有助于减轻网页开发时共通性活动的工 ...

  5. net项目总结一(1)

    中小型新闻发布系统 代码结构:分为实体层,数据层与接口,数据工厂层,业务逻辑层,公共层,UI层(由于图片上传实在麻烦,所以只上传少量而已),项目中用到了工厂模式,解耦BLL层和DLL层 1.登录功能, ...

  6. mysql 主从错误以及监控

    同步中的常见的错误和处理 1.现象:在从库上面show slave status\G;出现下列情况,           Slave_IO_Running: Yes           Slave_S ...

  7. [Swift]遍历集合类型(数组、集合和字典)

    Swift提供了三种主要的集合类型,称为数组,集合和字典,用于存储值集合. 数组是有序的值集合. 集是唯一值的无序集合. 字典是键值关联的无序集合. Swift中无法再使用传统形式的for循环. // ...

  8. C语言数据结构之图的基本操作

    本博文是是博主在学习数据结构图的这一章知识时做的一些总结,代码运行环境:visual studio2017 纯C语言 ,当然掌握了方法,你也可以试着用其它的语言来实现同样的功能. 下面的程序主要实现了 ...

  9. mysql 查询小技巧

    数据字段中存放的是id集,形如  1,2,15,35   也可类推json格式 查询时不用拆分了, 用上 instr.concat搜索和连接字符串 查询fids中包含15的 select * from ...

  10. C#-WebForm-★★★JQuery-动画★★★

    1.show(),hide() 瞬间显示或隐藏,隐藏后不占有位置 2.slideDown(),slideUp() 向下拉伸显示,向上缩减隐藏 3.fadeIn(),fadeOut() 渐显或渐隐,隐藏 ...