slawekjaranowski opened a new pull request, #13885:
URL: https://github.com/apache/maven/pull/13885
Fixes #13883
Maven 3.10.0 accepted an unprefixed `${rootDirectory}` as an alias for
`${project.rootDirectory}`.
Since this value source is evaluated before the model properties, it
shadowed a custom
`rootDirectory` property defined in the POM, e.g.:
```xml
<properties>
<rootDirectory>${project.basedir}</rootDirectory>
</properties>
```
In a multi-module build, `${rootDirectory}` then resolved to the project
root directory instead of
the module basedir (as it did in Maven 3.9.x), breaking builds such as
assertj/assertj-generator#339.
### Change
`AbstractStringBasedModelInterpolator`: the `rootDirectory` value source now
accepts only the prefixed
`${project.rootDirectory}` (and `${pom.rootDirectory}`), as
`${project.baseUri}` does.
The unprefixed form was never documented, and file-based profile activation
already supports
the prefixed form only.
Maven 4 is not affected; regression tests for it were added in #13884.
### Tests
- `AbstractModelInterpolatorTest` (run by
`StringSearchModelInterpolatorTest` and `StringVisitorModelInterpolatorTest`):
- `testRootDirectory`: `${project.rootDirectory}` resolves to the root
directory from a module
- `testCustomRootDirectoryPropertyIsNotShadowed`: a custom
`${rootDirectory}` property resolves
to its own value (fails without the fix)
- `testUnprefixedRootDirectoryIsNotInterpolated`: `${rootDirectory}` is
not an alias
(fails without the fix)
- `FileProfileActivatorTest`: the same two cases for file-based profile
activation
(already working, guarded against regressions)
### Documentation
`maven-model-builder/src/site/markdown/index.md`: file-based profile
activation supports
`${project.rootDirectory}` since Maven 3.10.0.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]