我在父pom中尝试了类似spring引导的模块,现在我遇到了错误。
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Failure to find org.springframework.boot:spring-boot-dependencies:pom:2.0.0.M6 in 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 @ line 30, column 19
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project mydomain.project:main-project:1.0-SNAPSHOT (D:\gitProjects\main-server\sources\pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Failure to find org.springframework.boot:spring-boot-dependencies:pom:2.0.0.M6 in 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 @ line 30, column 19 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException我尝试在.m2本地回购中删除我的项目
我有带有两个模块的maven项目(简单的java和spring引导)。我将父程序从spring引导提取到主pom (如dependensyManagment ),并将paren设置为spring引导-主项目。在那之后,我得到了这个错误
我恢复更改,所有操作都很好。一步地点,当所有的人压碎
org.springframework.boot spring-启动依赖项2.0.0.M6pom导入
org.springframework.boot弹簧-启动-启动器-双亲2.0.0.M6
对此:
<parent>
<artifactId>main-project</artifactId>
<groupId>main.project</groupId>
<version>1.0-SNAPSHOT</version>
</parent>发布于 2017-11-14 08:21:50
版本2.0.0.M6不在回购http://repo.maven.apache.org/maven2中。如果您不想使用此版本,则必须使用maven repo http://repo.spring.io/milestone。因此,将其添加到POM文件中:
<repositories>
<repository>
<id>spring-milestone-repo</id>
<url>http://repo.spring.io/milestone/</url>
</repository>
</repositories>我建议您使用spring的最新版本(1.5.8.RELEASE),而不是里程碑版本。我不知道POM是什么样子,但是您可以用不同的方式在POM中定义spring引导:
1.使用Spring父POM
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
</parent>然后,可以添加希望使用的依赖项,例如:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>请参阅:https://spring.io/guides/gs/spring-boot/
2.声明Spring中的依赖项-管理
如果您已经使用了自己的父POM,还可以在POM中导入spring引导依赖关系管理:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.8.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>与变量1一样,您可以在以后声明您希望使用的spring引导的依赖项。
发布于 2020-08-27 09:05:44
检查是否添加了spring启动依赖项,并且已经将spring引导作为父程序。那是我的案子。
https://stackoverflow.com/questions/47280247
复制相似问题