Repository navigation
Honour the full interpolation flag for profile activation of low validation level builds (fix #13347) - #13571
Conversation
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean, minimal fix. The isExternalModelBuildingRequest guard now correctly honours the existing maven.model.dependencyInterpolation.full opt-out flag for profile activation, not just interpolation. The refactoring of restrictExternalModelInterpolation into a shared isFullExternalInterpolation() helper eliminates duplication and is semantically equivalent (De Morgan's law). The orphaned comment removal is appropriate — it was a trailing fragment ending mid-sentence.
One naming observation: isFullExternalInterpolation now governs both interpolation restriction and profile activation scope, so the name is slightly narrower than its actual semantics. Something like isFullExternalModelBuild or isExternalInterpolationEnabled might be more precise — but this is a minor nit, not a blocker.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
Heads-up: this overlaps with the draft #13394, which fixes the same issue by also requiring |
…dation level builds (fix apache#13347)
7817970 to
b6272da
Compare
|
Renamed the helper to |
What and why
Since 3.10.0, a model built below
VALIDATION_LEVEL_MAVEN_2_0is treated as a repository POM: its profiles are activated in a sandbox that hides user properties and file activation.maven.model.dependencyInterpolation.full=trueis documented as the way to opt out, but it was only honoured by the interpolator. Profile activation ignored it, so a project built atMINIMALwith the flag set still lost its property-activated profiles (#13347).How
DefaultModelBuilder.isExternalModelBuildingRequestnow also checks the flag, through a sharedAbstractStringBasedModelInterpolator.isFullExternalInterpolation, so interpolation and activation agree. The flag can be a system or a user property. A POM's own<properties>still do not activate its profiles (#13390).An explicit marker on the request, set by the artifact descriptor reader instead of inferring it from the validation level, would also fix tools that build projects at
MINIMALwithout the flag. I left that for a separate change.Tests
Two new tests in
ResolvedDependencyProfileActivationTestfail without the change.maven-model-builderandmaven-corepass (420 tests) and spotless is clean. I did not run the integration tests.To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following: