gnodet opened a new issue, #12075:
URL: https://github.com/apache/maven/issues/12075

   ## Summary
   
   Maven 4 rejects POMs that use chained property references in 
`<distributionManagement>` IDs. The first level of interpolation resolves, but 
the second level is still a `${...}` expression when the validator runs, 
causing a failure.
   
   ## Reproduction
   
   Build [apache/ratis](https://github.com/apache/ratis) with Maven 4:
   
   ```
   mvn package -DskipTests
   ```
   
   ### Expected
   Build succeeds (as it does with Maven 3). All properties resolve through the 
chain.
   
   ### Actual
   ```
   [ERROR] 'distributionManagement.repository.[${distMgmtReleasesId}].id' 
contains an uninterpolated expression. @ line 37, column 7
   [ERROR] 
'distributionManagement.snapshotRepository.[${distMgmtSnapshotsId}].id' 
contains an uninterpolated expression. @ line 42, column 7
   ```
   
   ## Root Cause
   
   Ratis defines a layer of indirection on top of the Apache parent POM's 
`distributionManagement` properties:
   
   **Apache parent POM (`org.apache:apache:38`):**
   ```xml
   <properties>
       <distMgmtReleasesId>apache.releases.https</distMgmtReleasesId>
   </properties>
   <distributionManagement>
       <repository>
           <id>${distMgmtReleasesId}</id>
       </repository>
   </distributionManagement>
   ```
   
   **Ratis POM overrides `distributionManagement` with staging properties:**
   ```xml
   <properties>
       <distMgmtStagingId>${distMgmtReleasesId}</distMgmtStagingId>
   </properties>
   <distributionManagement>
       <repository>
           <id>${distMgmtStagingId}</id>
       </repository>
   </distributionManagement>
   ```
   
   The interpolation chain is: `${distMgmtStagingId}` → `${distMgmtReleasesId}` 
→ `apache.releases.https`
   
   Maven 4's validator runs after the first interpolation pass, sees 
`${distMgmtReleasesId}` (partially resolved), and rejects it. Maven 3 fully 
interpolates all nested properties before validation.
   
   ## Impact
   
   Only affects projects that add an extra indirection layer over the Apache 
parent's `distributionManagement` properties. Currently only ratis is affected 
in our test suite of ~960 Apache repositories.
   
   ## Environment
   
   - Maven: 4.0.0-SNAPSHOT (branch `maven-4.0.x-test-fixes`)
   - Java: 17.0.18 (Eclipse Adoptium)
   
   Test results: https://github.com/gnodet/maven4-testing/issues/9934
   
   _Claude Code on behalf of Guillaume Nodet_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to