eclipse 无法读取工件描述符 Spring Boot

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43045034/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 23:23:54  来源:igfitidea点击:

Failed to read artifact descriptor Spring Boot

javaspringeclipsemaven

提问by Praneeth Ramesh

I added dependency for spring-boot-starter-data-jpaand spring-boot-starter-jdbc. And I get problem: "Failed to read artifact descriptor..."

我为spring-boot-starter-data-jpaand添加了依赖spring-boot-starter-jdbc。我遇到问题:“无法读取工件描述符......”

This is error

这是错误

I downloaded jars and added manually in folder where are all dependency and I added like Referenced Libraries, but didn't help. Can someone help me?

我下载了 jars 并在所有依赖项的文件夹中手动添加,我添加了像引用库一样,但没有帮助。有人能帮我吗?

This is part of pom.xml:

这是 pom.xml 的一部分:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

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

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

回答by Praneeth Ramesh

Downloading the jars and adding manually will not add the dependencies and child dependecies. Also the pom would not have been updated. Try deleting the following folders

下载 jars 并手动添加不会添加依赖项和子依赖项。此外,pom 也不会更新。尝试删除以下文件夹

org.springframework.boot:spring-boot-starter-jdbc 

org.springframework.boot:spring-boot-starter-data-jpa

from your maven repository(.m2) and refresh the maven project(ALT + F5).

从您的 Maven 存储库(.m2)并刷新 Maven 项目(ALT + F5)。

Then u get can get the actual error(if exists) which u can post it here.

然后你可以得到实际的错误(如果存在),你可以在这里发布它。

回答by user4699744

It is very simple to resolve this issue. Just delete the .m2 folder from the users/username/ location and refresh the maven project in your eclipse workspace or delete the project and import again.

解决这个问题非常简单。只需从 users/username/ 位置删除 .m2 文件夹并刷新 eclipse 工作区中的 maven 项目或删除该项目并再次导入。