2

I've created a maven project by using STS4, but when I created, there was an error in line 5 file 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

Here is my file 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>

`

What should i do to solve this problem? Thanks a lot

Nghihoang
  • 29
  • 4

1 Answers1

0

You have to delete the *-not-available file in your local maven repository for org.springframework.boot:spring-boot-starter-parent:pom:2.6.13.

Look at e.g. ( if your local maven repository is .m2)

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

There could be another artefacts with this problem.

If you have too much of these problems you should delete the whole local maven repository.

Afterwards try your maven build with forced update option again.

Michael Katt
  • 615
  • 1
  • 5
  • 18