I am trying to setup a Maven project for a Spring Boot application but while trying to save the pom.xml file I am getting this following issue:
Project build error: Non-resolvable parent POM for
io.javabrains.springbootquickstart:course-api:0.0.1-SNAPSHOT: Could not find artifact
org.springframework.boot:spring-boot-starter-parent:pom:${revision} in central (https:// repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM
Here is my pom.xml file:
<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>
<groupId>io.javabrains.springbootquickstart</groupId>
<artifactId>course-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Java Api course</name>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2 RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>
This may be because of spring initializer created project pom file like this
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
However, sts is compatible with version "2.0.4.RELEASE", just make this change
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
further Maven -> Update Project
Solved the issue. There was a little mistake. It should be 1.4.2.RELEASE instead of 1.4.2 RELEASE. There should not be space between RELEASE and 2. This little dot was causing the issue.
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