Spring 无法解决执行器依赖关系
我试图在我的项目中包括spring actuator,但当我添加依赖项并运行maven clean install时,我得到一个错误: [错误]未能在项目演示上执行目标:无法解析项目com的依赖项。示例:演示:jar:0.0.1-SNAPSHOT:未能在org.springframework.boot:spring boot starter执行器:jar:2.2.4.RELEASE:未能读取org.springframework.boot:spring boot starter执行器:jar:2.2.4.RELEASE:无法传输工件org.springframework.boot:springbootstarter执行器:pom:2.2.4.RELEASE from/to central():repo.maven.apache.org:未知主机repo.maven.apache.org->[帮助1] 请参见下面我的pom文件:Spring 无法解决执行器依赖关系,spring,maven,dependencies,pom.xml,actuator,Spring,Maven,Dependencies,Pom.xml,Actuator,我试图在我的项目中包括spring actuator,但当我添加依赖项并运行maven clean install时,我得到一个错误: [错误]未能在项目演示上执行目标:无法解析项目com的依赖项。示例:演示:jar:0.0.1-SNAPSHOT:未能在org.springframework.boot:spring boot starter执行器:jar:2.2.4.RELEASE:未能读取org.springframework.boot:spring boot starter执行器:jar:2
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
4.0.0
org.springframework.boot
spring启动程序父级
2.2.4.1发布
com.example
演示
0.0.1-快照
演示
SpringBoot的演示项目
1.8
org.springframework.boot
SpringBootStarterWeb
org.springframework.boot
弹簧靴起动器
org.springframework.boot
弹簧起动试验
测验
org.junit.vintage
朱尼特老式发动机
org.springframework.boot
弹簧靴起动器执行器
org.springframework.boot
springbootmaven插件
如果我删除执行器依赖项,项目将成功构建
我试图找到问题,它似乎与我正在使用的spring boot starter父级版本冲突,但我找不到解决方案。这个问题实际上与spring或spring boot无关: 显然是maven中央存储库中的执行器。因此,这纯粹是一个专家问题 未知主机repo.maven.apache.org->[帮助1] 此异常意味着maven无法联系中央存储库并将启动器jar下载到本地存储库。 所以我会检查本地存储库,可能是空的,或者包含一些损坏的工件
mvn包
尝试强制更新依赖项。似乎未正确下载依赖项。同时检查您的internet连接这看起来像是网络/防火墙/代理问题