Reputation: 983
Am adding spring-boot parent in my pom.xml
file as given below
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1 RELEASE</version>
<relativePath/>
</parent>
i was change version version definition into <properties>
tag as given below
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>2.2.1.RELEASE</spring-boot.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot.version}</version>
<relativePath/>
</parent>
after this change am getting build error
Project build error: Non-resolvable parent POM for abc:abc:7.0.0.0: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:${spring-boot.version} 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 no local POM
i tried following solutions
<relativePath/> to <relativePath>/<relativePath>
<relativePath/> to <relativePath>../pom.xml/<relativePath>
Updated maven project
And also i tried following link stackoverflow
Upvotes: 2
Views: 548
Reputation: 19950
There is no way not to inherit properties from a parent POM. Properties defined in a parent are visible in the child.
Upvotes: 3