[versions-maven-plugin] Ignored usage of properties in child POMs

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[versions-maven-plugin] Ignored usage of properties in child POMs

Giovanni Lovato

Hello! I’m using versions-maven-plugin 2.7 and I have an issue with versions defined as properties in a multi-module project.

I have all version properties defined in the parent POM, then I have several child POMs defining dependency and plugin management.

When running `display-property-updates` on the parent POM, I would expect the plugin to resolve the property usage on its children; instead, it returns:

```
This project does not have any properties associated with versions.
```

Example POMs:

```xml
<project>
    <groupId>my.group</groupId>
    <artifactId>my-parent</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <properties>
        <version.foo>1.0.0</version.foo>
    </properties>
</project>
```

```xml
<project>
    <parent>
        <groupId>my.group</groupId>
        <artifactId>my-parent</artifactId>
        <version>1.0.0</version>
    </parent>
    <artifactId>my-artifact</artifactId>
    <packaging>pom</packaging>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>foo.group</groupId>
                <artifactId>foo-artifact</artifactId>
                <version>${version.foo}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
```

Output of plugin execution:

```
~/my-parent$ mvn versions:display-property-updates
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] my-parent                                                          [pom]
[INFO] my-artifact                                                        [pom]
[INFO]
[INFO] -------------------------< my.group:my-parent >-------------------------
[INFO] Building my-parent 1.0.0                                           [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.7:display-property-updates (default-cli) @ my-parent ---
[INFO]
[INFO] This project does not have any properties associated with versions.
[INFO]
[INFO]
[INFO] -----------------------< my.group:my-artifact >-------------------------
[INFO] Building my-artifact 1.0.0                                         [2/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.7:display-property-updates (default-cli) @ my-artifact ---
[INFO]
[INFO] This project does not have any properties associated with versions.
[INFO]
[INFO] my-parent .......................................... SUCCESS [  0.484 s]
[INFO] my-artifact ........................................ SUCCESS [  0.007 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.491 s
[INFO] Finished at: 2019-09-11T10:46:53+02:00
[INFO] ------------------------------------------------------------------------
```

GitHub issue: https://github.com/mojohaus/versions-maven-plugin/issues/367 <https://github.com/mojohaus/versions-maven-plugin/issues/367>