Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project 'org.springframework.boot:spring-boot-starter-parent:2.4.0' not found

I am following this guide: https://spring.io/guides/gs/serving-web-content/,

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

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.0</version>
        <relativePath/>
    </parent>

    <groupId>org.example</groupId>
    <artifactId>plats-bruts</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

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

</project>

but I have this problem on the pom:

Project 'org.springframework.boot:spring-boot-starter-parent:2.4.0' not found

but Its here https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.4.0

like image 916
en Lopes Avatar asked Nov 22 '20 11:11

en Lopes


People also ask

How to use Spring Boot starter parent in your project?

We can start using it in our project by adding this as a parent in our project's pom.xml: We can always get the latest version of spring-boot-starter-parent from Maven Central. 3. Managing Dependencies Once, we've declared the starter parent in our project, we can pull any dependency from the parent by just declaring it in our dependencies tag.

Does Spring Boot's starter parent pom exist in Maven Central?

This will take a while depending on your internet speed, but it will do a complete check of the broken downloads and stale Maven caches Spring Boot's starter parent pom certainly does exist in Maven Central. I copied your pom.xml and ran mvn test using Maven 3.6.3. All required libraries, including the parent pom were downloaded just fine.

How do I fix Maven errors in Spring Boot?

Clean your workspace, delete your local maven repository ( ~/.m2 ), or at least the org.springframework.boot tree, then update pom and try again. Generally, if maven finds a higher version the dependency is satisfied.

Where can I find the version of the Maven boot plugin?

In Maven library, it is found that the repository\ORG\springframework\boot\spring boot Maven plugin has related plug-ins 2.1.7. Release Supplement the version on pom.xml:


3 Answers

I just ran into a similar problem. I'm using IntelliJ IDEA Ultimate 2020.2. The version number 2.4.0 was red and the message was the same as yours.

Selecting File -> Invalidate Caches / Restart... and choosing the Invalidate and Restart option fixed the issue. I guess it was just a stale cache.

like image 118
fram Avatar answered Oct 25 '22 04:10

fram


What worked for me was re-building and remote caches and then local caches. Here're the steps I followed (on Mac, please translate to your target environment):

  1. Goto Preferences Menu: ie: IntelliJ IDEA > Preferences
  2. Under Build Tools: ie: "Build, Execution, Deployment" > Build Tools
  3. Select Repositories: ie: Maven > Repositories
  4. Notice the Remote and Local repositories, and the Update button
  5. Select Each repository and click Update. This will take a while depending on your internet speed, but it will do a complete check of the broken downloads and stale Maven caches
like image 4
SydMK Avatar answered Oct 25 '22 03:10

SydMK


Spring Boot's starter parent pom certainly does exist in Maven Central.

I copied your pom.xml and ran mvn test using Maven 3.6.3. All required libraries, including the parent pom were downloaded just fine. You will probably want to look at your ~/.m2/settings.xml file to see if any proxies are active that are preventing you from connecting to Maven Central.

like image 3
Laird Nelson Avatar answered Oct 25 '22 03:10

Laird Nelson