Problem
Maven 4's MavenValidator.validateDependency() rejects dependencies with uninterpolated property expressions (e.g., ${guava-version}) that are not defined anywhere. This affects projects like activemq-openwire which have dead/orphan managed dependency entries in <dependencyManagement> with undefined properties:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava-version}</version> <!-- property never defined -->
</dependency>
</dependencies>
</dependencyManagement>
Maven 3 silently ignores these because the dependency is never actually resolved. Maven 4 validates all dependency coordinates and rejects uninterpolated expressions:
Suppressed: java.lang.IllegalArgumentException: Not fully interpolated dependency com.google.guava:guava:jar:${guava-version} ()
The POM is arguably wrong, but mvnup could fix this automatically.
Proposed Solution
Add a new compatibility fix in CompatibilityFixStrategy that:
- Collects all properties defined in
<properties> sections across all project POMs (including profile properties)
- Scans
<dependencies> and <dependencyManagement> entries for ${...} expressions in groupId, artifactId, or version
- Skips well-known built-in properties (
project.*, env.*, settings.*, maven.*, revision, sha1, changelist, etc.)
- Comments out dependency entries whose property expressions are not defined in any project POM
Example output after fix:
<!-- mvnup: commented out - undefined property 'guava-version'
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava-version}</version>
</dependency>
-->
This runs as part of the default --model compatibility fixes.
Affected Projects (from RC-5 testing)
7 projects fail with this pattern:
- activemq-openwire (
${guava-version})
- mina-sshd
- causeway-app-helloworld, causeway-app-demo, causeway-app-simpleapp
- logging-log4j-audit
- sling-app-cms
Claude Code on behalf of Guillaume Nodet
Problem
Maven 4's
MavenValidator.validateDependency()rejects dependencies with uninterpolated property expressions (e.g.,${guava-version}) that are not defined anywhere. This affects projects likeactivemq-openwirewhich have dead/orphan managed dependency entries in<dependencyManagement>with undefined properties:Maven 3 silently ignores these because the dependency is never actually resolved. Maven 4 validates all dependency coordinates and rejects uninterpolated expressions:
The POM is arguably wrong, but
mvnupcould fix this automatically.Proposed Solution
Add a new compatibility fix in
CompatibilityFixStrategythat:<properties>sections across all project POMs (including profile properties)<dependencies>and<dependencyManagement>entries for${...}expressions in groupId, artifactId, or versionproject.*,env.*,settings.*,maven.*,revision,sha1,changelist, etc.)Example output after fix:
This runs as part of the default
--modelcompatibility fixes.Affected Projects (from RC-5 testing)
7 projects fail with this pattern:
${guava-version})Claude Code on behalf of Guillaume Nodet