Hello,

for a project I would like to resolve the "grandparent" version:

<grandparent.version>${project.parent.parent.version}</grandparent.version>

Unfortunately, with Maven 3.3.9 this simply doesn't work, the effective
pom shows it as unresolved:

<grandparent.version>${project.parent.parent.version}</grandparent.version>

I can reproduce it with any new probject a simple way is, for example,
using a spring boot project (which should have a parent
(spring-boot-parent) and a grandparent (spring-boot-dependencies):

<?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.example</groupId>
        <artifactId>demo</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>jar</packaging>

        <parent>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
                <version>1.4.2.RELEASE</version>
                <relativePath/> <!-- lookup parent from repository -->
        </parent>

        <properties>
                
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
                <java.version>1.8</java.version>

<grandparent.version>${project.parent.parent.version}</grandparent.version>
        </properties>   
        
</project>

Any ideas how to access the parent.parent.version otherwise?
Unfortunately, I only found closed issues where
${project.parent.parent.version} was given as a workaround...

Reply via email to