gpt4 book ai didi

java - Maven 在 Eclipse 中找不到 Artifact 命令 spring-boot-starter-parent

转载 作者:行者123 更新时间:2023-12-02 05:03:28 24 4
gpt4 key购买 nike

当我尝试在 Eclipse 上运行任何 Maven 命令时出现错误。

错误信息:

[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

我检查的事情:

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

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

包含文件:spring-boot-starter-parent-2.1.5-RELEASE.pom.lastUpdated

  • 手动清理存储库,并在 Eclipse 上运行干净。

  • 我在 eclipse 中的 settings.xml 配置已设置到正确的位置,并且我的本地存储库的 eclipse 配置也已定义良好。

  • 未定义代理。

  • 有关我的配置和环境的信息:

    我在 Ubuntu 上使用 eclipse。

    settings.xml 文件:

    <?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 文件:

       <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 版本:

    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"

    最佳答案

    • 强力/清理您的 ~/.m2/repository 目录/只需将其删除,它将在下一个版本中重新填充。
    • settings.xml:检查存储库的“updatePolicy”。通常,版本从不检查更新,并且 SNAPSHOT 有默认值。我经常设置间隔:13(13分钟)

    关于java - Maven 在 Eclipse 中找不到 Artifact 命令 spring-boot-starter-parent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56371621/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com