首页 > 解决方案 > 项目构建错误:Non-resolvable parent POM: Failure to transfer org.springframework.boot:spring-boot-starter-parent:

问题描述

有人帮助我,我在尝试保存 pom.xml 文件时遇到了以下问题:

项目构建错误:Non-resolvable parent POM: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.5.0 from http://uk.maven.org/maven2 is cached in the local repository , 直到 UK 的更新间隔已过或强制更新后才会重新尝试解决。原始错误:无法将工件 org.springframework.boot:spring-boot-starter-parent:pom:2.5.0 从/到英国(http://uk.maven.org/maven2):null 到 http:// uk.maven.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.5.0/spring-boot-starter-parent-2.5.0.pom 和“parent.relativePath”指向没有本地 POM

这是我的 pom.xml

4.0.0 org.springframework.boot spring-boot-starter-parent 2.5.0 com.example MaBanque 0.0.1-SNAPSHOT MaBanque Demo project for Spring Boot <java.version>11</java.version> org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-security org.springframework.boot spring-boot-starter-thymeleaf org.thymeleaf.extras thymeleaf-extras-springsecurity5

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

标签: javaspringspring-bootmavenjava-ee-6

解决方案


被缓存在本地存储库中,看起来你的maven无法加载尝试重新安装maven,然后使用https://start.spring.io尝试生成这个项目


推荐阅读