I had installed Eclipse (actually Spring Tool Suite). It came with Maven. I had created Spring boot starter projects. Maven was downloading all the dependencies and things were working fine.
Recently, I created a new project. This time, I noticed an error in pom.xml and the problem window (in STS) showing the following:
Description Resource Path Location Type Unknown pom.xml /TestSessionAttribute line 1 Maven Configuration Problem
I noticed that the spring boot version was at 2.1.5 (it was 2.1.4 before).
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.5.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
I went ahead and did an update of the project (Maven > Update project) with the 'Force Update of Snapshots/Releases' checked. This did not resolve the problem. I do see the
spring-boot-2.1.5.RELEASE.jar
in the m2 repository.
I went back and changed the version to 2.1.4 and then a Maven > Update Project and the errors went away.
Why am I getting the Maven error when version is 2.1.5?
Spring Boot is compatible with Apache Maven 3.3 or above. If you do not already have Maven installed, you can follow the instructions at maven.apache.org. On many operating systems, Maven can be installed with a package manager. If you use OSX Homebrew, try brew install maven .
The Spring Boot Maven Plugin provides Spring Boot support in Apache Maven. It allows you to package executable jar or war archives, run Spring Boot applications, generate build information and start your Spring Boot application prior to running integration tests.
According to this link you can fix the issue by downgrading the maven-jar-plugin to 3.1.1 (from 3.1.2). I can confirm that the fix works for my own projects.
Add the following entry to your pom to fix that issue.
<properties> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> </properties>
An official bug entry for eclipse exists as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With