Repository navigation
Closed
Labels
bugSomething isn't working
Description
Hey all,
We have a use-case for update-property when the property is defined in the parent pom and the corresponding dependency is managed in the module.
As an example, assume having a multimodule maven project:
<?xml version="1.0" encoding="UTF-8"?>
<!--ROOT POM:-->
<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.acme</groupId>
<artifactId>my-artifact-parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>module1</module>
</modules>
<properties>
<version.some.lib>1.0.0.Final</version.some.lib>
</properties>
</project><?xml version="1.0" encoding="UTF-8"?>
<!--Module POM:-->
<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>
<parent>
<groupId>com.acme</groupId>
<artifactId>my-artifact-parent</artifactId>
<version>1.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>module1</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>some</groupId>
<artifactId>lib</artifactId>
<version>${version.some.lib}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>and let's assume there's a 2.0.0.Final version of this lib. Running
mvn versions:update-property -Dproperty=version.some.libhas no effect on such POMs, since the property lives in a parent and the plugin only considers a current pom file for editing:
Line 476 in 6cd759c
| } else if (PomHelper.setPropertyVersion(pom, version.getProfileId(), property.getName(), winner.toString())) { |
Would it be possible to support such a case and update the property in the parent pom?
Reacted by James Hollowell, dmatthijssen, Joe Di Pol and Mark Chesney
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
andrzejj0 commentedon Feb 24, 2024
Similar to #837, but in this case the mojo is applied on the reactor.
github-actions commentedon Feb 24, 2025
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 30 days.
dmatthijssen commentedon Feb 26, 2025
This is still relevant, we have loads of multi-module projects and this issue makes the update-property unusable.
github-actions commentedon Feb 27, 2026
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 30 days.
marko-bekhta commentedon Feb 27, 2026
would still like to see this one addressed at some point 🙂 🤞🏻