1
votes

I'm trying to add dependencies to my maven project. I want to add spring boot configuration. but it gives this error in parent tag,

Project build error: Non-resolvable parent POM for
io.javabrains.springbootquickstart:course-api:0.0.1-SNAPSHOT: Failure to find
org.springframework-boot:spring-boot-starter-parent:pom:1.4.2.RELEASE in https:// repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and
'parent.relativePath' points at wrong local POM

I tried with adding relative path to this. But it didn't seem to work out.

<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 Brains course API</name>

  <parent>
   <groupId>org.springframework-boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>1.4.2.RELEASE</version>
  <relativePath>../course_api/pom.xml</relativePath>
  </parent>
</project>
1
What's the point of relativePath tag in the parent tag? Maybe that's because of it? - chubock
no i found it after the error occurs. stackoverflow.com/questions/7612309/… - Pasindu Senarath
but it didn't solve the error anyway :( - Pasindu Senarath
relativePath usage is for addressing parent pom file from your filesystem which is not your usecase. I think it's better to send the error you get when you remove it. - chubock

1 Answers

0
votes

You’ve made a small typo in the configuration of your project’s parent. You have used a - rather than a .. You have org.springframework-boot and it should be org.springframework.boot.

Your parent should be the following:

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>1.4.2.RELEASE</version>
</parent>