无法从maven下载依赖项
Can not download dependencies from maven
一个月前,我可以从头开始在我的 IntelliJ IDEA 上成功构建我的 Java 应用程序,现在,我必须升级我的 spring-boot 以获得一些新功能。但是,在我将 spring-boot 的版本从 2.2.2.RELEASE 更改为其他版本并单击 Reload All Maven Projects 按钮后,我收到消息:
org.springframework.boot:spring-boot-starter-parent:pom:2.6.3 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not 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:2.6.3 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.6.3/spring-boot-starter-parent-2.6.3.pom
一个月前还可以下载2.2.2.RELEASE。
为什么此时更新失败?
我的资料如下:
MacOS 12.2,捆绑 (Maven 3),Java of 1.8,IntelliJ IDEA 2021.3 ultimate。
我的pom.xml:
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.*</groupId>
<artifactId>web-site</artifactId>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>study-info</module>
<module>cloud-api</module>
</modules>
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath/>
</parent>
<properties>
<mysql-connector-version>8.0.16</mysql-connector-version>
<lombok-version>1.18.10</lombok-version>
</properties>
<dependencyManagement>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok-version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
网络错误。
我更改了 phone 热点的另一个网络,它工作正常。
一个月前,我可以从头开始在我的 IntelliJ IDEA 上成功构建我的 Java 应用程序,现在,我必须升级我的 spring-boot 以获得一些新功能。但是,在我将 spring-boot 的版本从 2.2.2.RELEASE 更改为其他版本并单击 Reload All Maven Projects 按钮后,我收到消息:
org.springframework.boot:spring-boot-starter-parent:pom:2.6.3 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not 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:2.6.3 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.6.3/spring-boot-starter-parent-2.6.3.pom
一个月前还可以下载2.2.2.RELEASE。 为什么此时更新失败? 我的资料如下: MacOS 12.2,捆绑 (Maven 3),Java of 1.8,IntelliJ IDEA 2021.3 ultimate。
我的pom.xml:
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.*</groupId>
<artifactId>web-site</artifactId>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>study-info</module>
<module>cloud-api</module>
</modules>
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath/>
</parent>
<properties>
<mysql-connector-version>8.0.16</mysql-connector-version>
<lombok-version>1.18.10</lombok-version>
</properties>
<dependencyManagement>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok-version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
网络错误。 我更改了 phone 热点的另一个网络,它工作正常。