使用Eclipse自带Maven创建SpringBoot报错
Maven安装包下载 https://download.****.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项目就不会报错了。