【问题标题】:Non resolvable parent POM when create Maven project创建 Maven 项目时不可解析的父 POM
【发布时间】:2022-11-24 16:56:58
【问题描述】:

我已经使用STS4创建了一个maven项目,但是创建时,第5行文件pom.xml中出现错误:

Non-resolvable parent POM for com.example:demo2:1.0: org.springframework.boot:spring-boot-starter-parent:pom:2.6.13 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.13 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org

这是我的文件 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 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.6.13</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo2</artifactId>
    <version>1.0</version>
    <name>demo2</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>11</java.version>
    </properties>
    <dependencies>
        <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>
        </dependency>
    </dependencies>

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

</project>

`

我应该怎么做才能解决这个问题?非常感谢

【问题讨论】:

  • 也许是网络问题?

标签: java eclipse maven


【解决方案1】:

你必须删除*-无法使用org.springframework.boot:spring-boot-starter-parent:pom:2.6.13 的本地 Maven 存储库中的文件。

看看例如(如果您的本地 Maven 存储库是 .m2)

.m2/org/springframework/boot/spring-boot-starter-parent/2.6.13/

【讨论】:

  • 我已经删除了这个文件,但我仍然遇到这个错误
猜你喜欢
  • 2021-11-16
  • 1970-01-01
  • 2023-03-05
  • 2011-11-28
  • 1970-01-01
  • 2019-03-31
  • 2013-11-14
相关资源
最近更新 更多