Maven报错:maven-archetype-webapp:RELEASE from any of the configured repositories
今天学习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配置是这样的:
- <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>
<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,添加后如下:
- <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>
<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的更多相关文章
- 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 ...
- springboot maven 报错ArtifactDescriptorException
maven具体报错提示如下: Description Resource Path Location TypeArtifactDescriptorException: Failed to read ar ...
- maven报错非法字符:\65279 错误
开发中一个项目很早就报这个错,maven报错非法字符:\65279 错误,今天终于忍无可忍要解决它 :编译java文件的时候,有些java文件报非法字符 \65279错误,在网上找和很多 方法,也试了 ...
- 转:maven报错非法字符:\65279 错误
开发中一个项目很早就报这个错,maven报错非法字符:\65279 错误,今天终于忍无可忍要解决它 :编译java文件的时候,有些java文件报非法字符 \65279错误,在网上找和很多 方法,也试了 ...
- [转]解决Maven报错"Plugin execution not covered by lifecycle configuration"
[转]解决Maven报错"Plugin execution not covered by lifecycle configuration" 导入Myabtis源码后,POM文件会报 ...
- 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 ...
- 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 ...
- 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 ...
- 关于Maven报错的一些解决办法(别处贴的)
1.警告:The tag handler class for "s:form"(org.apache.struts2.views.jsp.ui.FormTag) was not f ...
随机推荐
- 通过代码去执行testNG用例
背景 用testNG去编写的测试用例,通过@Test去执行用例,一般本地都是通过IDE去执行相应的方法,持续集成的话,都是通过maven来执行或指定testNG.xml执行,但是如果想通过接口/界面去 ...
- DotNetBar.MetroTilePanel 样式、加载数据、获取数据
描述下:MetroTilePanel包含子集ItemContainer 子集下面又包含子集MetroTileItem 目前我用到的就是这三层 因为需求所以整个模块全部由代码实现 1.ItemCon ...
- PostgreSQL查询数据(连接查询和子查询)
原料 --用户表 create table "SysUser"( "UserId" serial, --用户Id,自增 "UserName" ...
- .net core 2.0 mvc 初步学习
mvc_study *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !impor ...
- WEB文本框提示
<input type="text" placeholder="文本框提示语" name="version_no"/>
- php中的XML DOM(11)
7.创建节点 在dom操作中,增删改操作必须要找父节点 1.DOMElement DOMDocument::createElement ( string $name [, string $value ...
- SQLAlchemy和Flask-SQLAlchemy
一.ORM 与 SQLAlchemy 简介 ORM 全称 Object Relational Mapping, 翻译过来叫对象关系映射.简单的说,ORM 将数据库中的表与面向对象语言中的类建立了一种对 ...
- excel冻结窗口
Excel中如果输入内容太多,希望滚动时候,可以看到表头,需要冻结表格.如果我们选中C3表格,执行冻结操作,会看到C3左边和上边有两条直线,这样C3的左边和上边的表格都没法变动,因此冻结表格只能冻结首 ...
- 爬虫4:re库
一. 常见匹配模式 模式 描述 \w 匹配字母数字及下划线 \W 匹配非字母数字下划线 \s 匹配任意空白字符,等价于 [\t\n\r\f]. \S 匹配任意非空字符 \d 匹配任意数字, ...
- day00 -----博客作业1
问题1.使用while循环输入 1 2 3 4 5 6 8 9 10 i = 0 while i<10: i+=1 if i ==7: continue print(i) 问题2 求1- ...