使用Eclipse自带Maven创建SpringBoot报错

版权声明:本文为博主原创文章,转载请说明出处。 https://blog.csdn.net/qq_42361748/article/details/88625498

Maven安装包下载 https://download.csdn.net/download/qq_42361748/11029654

在学习SpringBoot的时候,创建maven项目的时候,添加parent标签,报错误:

Project build error: Non-resolvable parent POM for model:maven01:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:1.5.3.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.3.RELEASE from/to central (https://repo.maven.apache.org/maven2): connect timed out and ‘parent.relativePath’ points at wrong local POM
自己下载maven配置,解决问题
将下载好的Maven安装到指定的目录。我的是压缩包,直接解压到E盘下。(自己随意指定)
在这里插入图片描述在这里插入图片描述
配置环境变量,新建名称为 MAVEN_HOME 的系统变量,变量值为maven的安装目录路径 E:\apache-maven-3.5.0
在这里插入图片描述
创建成功。
在这里插入图片描述
找到Path,在里面添加%MAVEN_HOME%\bin。添加成功。
在这里插入图片描述
找到conf目录,打开 settings.xml。
在这里插入图片描述
在里面添加本地仓库的位置 E:/m2/repository,保存
在这里插入图片描述
回到Eclipse—Window—Preferences–Maven-Installations–Add
在这里插入图片描述
将本地的Maven添加进来,因为的我已经添加进来了,所以不能在添加了。然后应用。ok
在这里插入图片描述
在这里插入图片描述
然后创建Maven项目就不会报错了。

猜你喜欢

转载自blog.csdn.net/qq_42361748/article/details/88625498