Description
When a POM contains <url>${project.url}</url>, Maven 4 now correctly detects this as a recursive variable reference and fails with an error, while Maven 3 did not detect this issue.
Example
A POM with the following content:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<url>${project.url}</url>
</project>
Behavior
Maven 3
- Build may succeed (recursive reference not detected)
- No error or warning about the recursive reference
Maven 4
- Build fails with:
[ERROR] recursive variable reference: project.url
- For dependency POMs: Shows warning but continues build
Real-world Impact
This issue was observed with dependencies like com.slack.api:slack-api-client:jar:1.45.4 which contain similar recursive references in their POMs:
[WARNING] The POM for com.slack.api:slack-api-client:jar:1.45.4 is invalid, transitive dependencies (if any) will not be available: 1 problem was for com.slack.api:slack-api-client:jar:1.45.4
- [ERROR] recursive variable reference: project.url
Expected Behavior
Maven 4's behavior is correct - it should detect and prevent recursive variable references to avoid infinite loops during variable resolution. This is an improvement in Maven 4's variable interpolation system.
Proposed Solution
This issue is primarily for documentation and testing purposes. An integration test should be created to verify this behavior and ensure it continues to work correctly in future versions.
Environment
- Maven 4.0.0+ (all versions)
- Affects both direct POM recursive references and dependency POM recursive references
Related
This is related to the improved variable resolution and interpolation system in Maven 4.
Description
When a POM contains
<url>${project.url}</url>, Maven 4 now correctly detects this as a recursive variable reference and fails with an error, while Maven 3 did not detect this issue.Example
A POM with the following content:
Behavior
Maven 3
Maven 4
[ERROR] recursive variable reference: project.urlReal-world Impact
This issue was observed with dependencies like
com.slack.api:slack-api-client:jar:1.45.4which contain similar recursive references in their POMs:Expected Behavior
Maven 4's behavior is correct - it should detect and prevent recursive variable references to avoid infinite loops during variable resolution. This is an improvement in Maven 4's variable interpolation system.
Proposed Solution
This issue is primarily for documentation and testing purposes. An integration test should be created to verify this behavior and ensure it continues to work correctly in future versions.
Environment
Related
This is related to the improved variable resolution and interpolation system in Maven 4.