1
votes

This is my first project using spring boot. So I tried to update the pom.xml with the parent as below:

<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>com.in28minutes.springboot</groupId>
    <artifactId>first-springboot-project</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <name>springboot-in-10-steps</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.BUILD-SNAPSHOT</version> <!-- lookup parent from repository -->
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
</project>

However, I got an error in line:

Project build error: Non-resolvable parent POM for com.in28minutes.springboot:first-springboot-project:0.0.1-SNAPSHOT: Could not find artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.BUILD-SNAPSHOT and 'parent.relativePath' points at wrong local POM

any help please !

enter image description here

2
Change into <relativePath/>khmarbaise

2 Answers

4
votes

There no such thing as 2.0.0-BUILD-SNAPSHOT, you might have copied this directly from a Spring Boot project?

The released version of Spring Boot can be seen here;

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

If you want the latest verison, <version>2.0.6.RELEASE</version> will work.

If you want to use SNAPSHOT, or Milestone releases see the documentation

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/html/getting-started-installing-spring-boot.html#getting-started-maven-installation

which specifies the required repos.

1
votes

Change 2.0.0.BUILD-SNAPSHOT to 2.0.0.RELEASE