3

Here is my pom.xml

<?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>
    <groupId>com.skm</groupId>
    <artifactId>MyApps</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <parent> <!-- Problem -->
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.2.RELEASE</version>
        <relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
    </parent>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

This line <parent> is causing problem.

Project build error: Non-resolvable parent POM for com.skm:MyApps:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.2.RELEASE from 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. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.2.RELEASE from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' points at wrong local POM

I have seen these links but unable to resolve it.

Maven: Non-resolvable parent POM Maven: Non-resolvable parent POM

Adam
  • 5,215
  • 5
  • 51
  • 90
Faizan Mubasher
  • 4,427
  • 11
  • 45
  • 81
  • Try to change `../pom.xml` by ` `, it is not finding the pom from that route – dgarceran May 16 '18 at 07:14
  • Possible duplicate of [Maven Problems: Project build error: Non-resolved parent POM](https://stackoverflow.com/questions/38366826/maven-problems-project-build-error-non-resolved-parent-pom) – Vipul Gulhane Jun 26 '18 at 07:09

1 Answers1

6

You are pointing to a Parent pom that does not exist in your local repository. You should remove value for <relativePath> tag so that maven could fetch the pom file from maven central repository.

Change your parent tag as shown below.

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.2.RELEASE</version>
    <relativePath />
</parent>
Raja Anbazhagan
  • 4,092
  • 1
  • 44
  • 64