Eclipse showing "Maven Configuration Problem: Unknown"

JavaMavenSpring Boot

Java Problem Overview


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

![error][1]

[1]: https://i.imgur.com/jfCIVpP.png "mvn unknown problem"

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>

Java Solutions


Solution 1 - Java

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

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>

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>

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

Solution 2 - Java

Step 1:

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

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

Step 2 Update Project

  • Right Click on your Project
  • Go to Maven
  • Click on Update Project
  • Clean and Re-Run your Application

enter image description here


enter image description here

Solution 3 - Java

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

Add this dependency in pom.xml under properties tag

Solution 4 - Java

For spring boot project I have added this:

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

Solution 5 - Java

Was Getting exact same error. Solution by Gybandi kinda worked for me.

  • Updating project in Maven> menu does nothing to make error icon go away.

  • Did the 3.1.1 and then did a maven -> update project from context menu. The red (x) icon is now GONE :-). But I really don't want to downgrade my maven plugin, if possible.

  • The suggestion of updating m2e-connector from eclipse marketplace does not work. All I see against the m2e-connector entry is a "learn more" link which takes me to its webpage. Nothing like "upgrade/update" button present.

Solution 6 - Java

if you are using spring boot downgrade the version to 2.1.4.RELEASE instead of 2.1.5.RELEASE it will solve the problem

Solution 7 - Java

I am using eclipse photon and had similar issue. Didnt want to add the maven-jar-plugin.version in my pom as I dont want my codebase to contain code specific to IDE.

What I noticed is eclipse photon has m2e version of 1.5 which is causing the problem. I uninstall all the m2e connectors, restarted my eclipse and then installed the m2e connector using the below url manually

https://download.eclipse.org/technology/m2e/releases/1.13/

this worked like a charm

Solution 8 - Java

Adding packaging tag solved my problem. Didn't need to lower maven-jar plugin version.

<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.2.2.RELEASE</version>
	<relativePath/>
</parent>

Solution 9 - Java

I fixed this issue by changing the version from 2.1.6 to 2.1.3

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

I changed this to 2.1.3 because there were two versions were shown available in local m2 repository at below path

.m2\repository\org\springframework\boot\spring-boot-starter-parent

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionR&#244;mulo SoratoView Question on Stackoverflow
Solution 1 - JavagybandiView Answer on Stackoverflow
Solution 2 - JavaRomil PatelView Answer on Stackoverflow
Solution 3 - JavaTanmay NaikView Answer on Stackoverflow
Solution 4 - JavaAvinash KhadsanView Answer on Stackoverflow
Solution 5 - JavaG.A.View Answer on Stackoverflow
Solution 6 - JavaKhaled JamalView Answer on Stackoverflow
Solution 7 - JavaRavikiran buttiView Answer on Stackoverflow
Solution 8 - JavaRohan PatilView Answer on Stackoverflow
Solution 9 - JavaRAroraView Answer on Stackoverflow