Eclipse显示"Maven配置问题:未知". [英] Eclipse showing "Maven Configuration Problem: Unknown"

查看:55
本文介绍了Eclipse显示"Maven配置问题:未知".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚导入了我在 https://start.spring.io/中创建的spingboot项目蚀. 我尝试导入两次,但是问题仍然存在. 已经尝试执行mvn更新,mvn全新安装,试图清除项目,但是这些都不起作用. 这是pom xml文件的第一行中的问题. 我不知道如何解决这个问题. 我正在使用Java 11

I just imported a spingboot project that I created in https://start.spring.io/ in eclipse. I tried to import two times, but the problem persists. Already tried to do a mvn update , a mvn clean install, tried to clean the project but none of this worked. Its a problem in the first line of pom xml file. I dont have any idea how to solve this. I'm using java 11

这是完整的POM文件:

This is the complete POM file:

<?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.1.5.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.springboot.rest.example</groupId>
<artifactId>spring-boot-2-jpa-with-hibernate-and-h2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot-2-jpa-with-hibernate-and-h2</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-data-jpa</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>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </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>

推荐答案

这似乎是Eclipse中的错误: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547340

This seems like a bug in eclipse: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547340

您可以通过将Maven jar插件版本从3.1.2暂时降级到3.1.1来解决此问题.将此添加到 properties 部分:

You can fix this by temporary downgrading the maven jar plugin version to 3.1.1 from 3.1.2. Add this to the properties section:

<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>

所以pom看起来像这样:

So your pom will look like this:

<?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.1.5.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.springboot.rest.example</groupId>
<artifactId>spring-boot-2-jpa-with-hibernate-and-h2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot-2-jpa-with-hibernate-and-h2</name>
<description>Demo project for Spring Boot</description>

<properties>
    <java.version>11</java.version>
    <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</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>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </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>

更新: 修复程序已发布.单击帮助>在Eclipse/STS中检查更新,然后安装最新的m2e连接器.

Update: A fix has been released. Click Help > Check for updates in Eclipse/STS and install the newest m2e connector.

这篇关于Eclipse显示"Maven配置问题:未知".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆