waterWang opened a new pull request, #12734:
URL: https://github.com/apache/maven/pull/12734

   ### Problem
   
   Maven 4.0.0-rc6 does not interpolate properties in `<module>` (or 
`<subproject>`) paths of aggregator POMs. For example:
   
   ```xml
   <properties>
       <version-discriminator>-v14</version-discriminator>
   </properties>
   <modules>
       <module>./../module/pom${version-discriminator}.xml</module>
   </modules>
   ```
   
   Maven 3 correctly interpolates `${version-discriminator}` to produce 
`./../module/pom-v14.xml`, but Maven 4 fails with:
   
   ```
   [ERROR] Child subproject .../pom${version-discriminator}.xml of ... does not 
exist
   ```
   
   ### Root Cause
   
   In `DefaultModelBuilder.loadFilePom()`, the subproject/module path strings 
are resolved against the filesystem **before** model-wide property 
interpolation runs. The path `${version-discriminator}` is never resolved, so 
Maven 4 treats it as a literal directory name.
   
   ### Fix
   
   Interpolate each subproject path string against the model, user, and system 
properties before resolving it against the filesystem. This is a targeted 
interpolation of the path only — the full model interpolation still runs later 
in the build pipeline, unchanged.
   
   ### Testing
   
   - Maven 3 behavior: module paths with `${property}` references are correctly 
interpolated
   - This fix restores that behavior in Maven 4 by interpolating the path 
before the filesystem lookup
   - Non-interpolated paths (the common case) pass through unchanged
   
   Fixes #12729


-- 
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