Home > Net >  Can not download dependencies from maven
Can not download dependencies from maven

Time:02-03

A month ago, I can build my Java Application successfully on my IntelliJ IDEA from scratch, and now, I have to upgrade my spring-boot to get some new features. But, after I change the version of spring-boot from 2.2.2.RELEASE to other version and click the button of Reload All Maven Projects, I get the message:

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

It was fine a month ago for downloading 2.2.2.RELEASE. Why does the update fail at this time? My information is as follows: MacOS 12.2,Bundled (Maven 3), Java of 1.8, IntelliJ IDEA 2021.3 ultimate.

my 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>

CodePudding user response:

It is a network error. I changed another network of my phone's hotspot and it worked.

  •  Tags:  
  • Related