Idea 新建springboot项目 spring-boot-starter-parent 包maven依赖报错
程序员文章站
2022-03-04 14:44:51
...
今天使用Idea导入spring-boot 项目时 maven 报错
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.15.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
然后感觉就是自己maven镜像里面搜不到这个包,所以找到maven的setting.xml 修改镜像 之后update poject 项目就开始下载pom.xml中的jar包啦
setting.xml 修改前
<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>
-->
<id>mirrorId</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://central.maven.org/maven2/</url>
</mirrors>
具体为添加镜像
<id>mirrorId</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://central.maven.org/maven2/</url>
上一篇: 黑鲨5搭载的什么处理器?黑鲨5处理器介绍
推荐阅读
-
idea新建springboot项目pom文件报错
-
IDEA新建一个简单的springboot项目(选择maven版)
-
maven多项目打包报错---子模块相互依赖打包时所遇到的问题:依赖的程序包找不到 package xxx does not exist
-
使用idea构建Maven项目时,控制台不报错但是External Libraies中总是无法获取依赖包
-
IDEA新建一个简单的springboot项目(选择maven版)
-
idea在maven项目中添加jar包和依赖
-
idea maven项目 打jar 打进去依赖包
-
IDEA新建maven项目报错Unable to import maven project: See logs for details && IDEA Maven 报错 No implementati
-
springboot项目maven打包编译第三方jar包,报错:找不到符号,找不到jar中的类
-
Idea新建maven项目报错:Unable to import maven project: See logs for details