简体   繁体   中英

Maven could not find artifact command in eclipse spring-boot-starter-parent

I get an error when I try to run any Maven command on eclipse.

The error message:

[ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.me.learn:first-application:0.0.1-SNAPSHOT: 
Failure to find org.springframework.boot:spring-boot-starter-parent:pom:2.1.5-RELEASE 
in https://repo.maven.apache.org/maven2 was cached in the local repository, 
resolution will not be reattempted until the update 
interval of central has elapsed or updates are forced and 'parent.relativePath' 
points at wrong local POM @ line 6, column 10

Things that I checked:

  1. Project build error: Non-resolvable parent POM. Failure to transfer org.springframework.boot:spring-boot-starter-parent

  2. The directory /home/{anonymous}/.m2/repository/home/{anonymous}/.m2/repository/org/springframework/boot/spring-boot-starter-parent

contains the file: spring-boot-starter-parent-2.1.5-RELEASE.pom.lastUpdated

  1. Manually cleaning the repository, and running clean on eclipse.

  2. My configuration of settings.xml in eclipse is set to the correct place, and my configuration of eclipse to my local repository is defined good as well.

  3. No proxy is defined.

Information about my configurations and environment:

I'm using eclipse over Ubuntu.

settings.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <localRepository>/home/{anonymous}/.m2/repository</localRepository>
  <interactiveMode>true</interactiveMode>
  <usePluginRegistry>false</usePluginRegistry>
  <offline>false</offline>

</settings>

pom.xml file:

   <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/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>

        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.1.5-RELEASE</version>
        </parent>

        <groupId>com.me.learn</groupId>
        <artifactId>first-application</artifactId>
        <packaging>pom</packaging>
        <version>0.0.1-SNAPSHOT</version>
        <name>first-application</name>
        <url>http://maven.apache.org</url>

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

        <build>
            <finalName>first-application</finalName>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    </project>

Maven version:

Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-37-generic", arch: "amd64", family: "unix"
  • Brute force / clean your ~/.m2/repository directory / just delete it and it will be repopulated on next build.
  • settings.xml : check into the "updatePolicy" for repositories. Generally, releases never check for updates and SNAPSHOT have a default. I often set interval:13 (13 minutes)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM