Skip to content

Allow ${project.basedir} in profile activation.condition - #11528

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
fix/model-validator-activation-condition-basedir
Dec 9, 2025
Merged

gnodet merged 1 commit into
maven-4.0.xfrom
fix/model-validator-activation-condition-basedir

Conversation

@gnodet

@gnodet gnodet commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Previously, ${project.basedir} was only allowed in activation.file.exists and activation.file.missing. This change extends the same allowance to activation.condition, which is a new Maven 4.0.0 feature that also needs to reference the project base directory for its expressions.

This fixes a false positive warning when using expressions like exists("${project.basedir}/src/main/java") in activation conditions.

Changes

  • Updated DefaultModelValidator to allow ${project.basedir} in activation.condition path
  • Added unit test for the new behavior

Pull Request opened by Augment Code with guidance from the PR author

Previously, ${project.basedir} was only allowed in activation.file.exists
and activation.file.missing. This change extends the same allowance to
activation.condition, which is a new Maven 4.0.0 feature that also needs
to reference the project base directory for its expressions.

This fixes a false positive warning when using expressions like
exists("${project.basedir}/src/main/java") in activation conditions.
@gnodet gnodet added bug Something isn't working mvn40 labels Dec 8, 2025
@gnodet
gnodet requested a review from cstamas December 9, 2025 06:21
@gnodet
gnodet merged commit fde7213 into maven-4.0.x Dec 9, 2025
25 checks passed
@gnodet
gnodet deleted the fix/model-validator-activation-condition-basedir branch December 9, 2025 19:51
@github-actions github-actions Bot added this to the 4.0.0 milestone Dec 9, 2025
gnodet added a commit to gnodet/maven that referenced this pull request Dec 9, 2025
Previously, ${project.basedir} was only allowed in activation.file.exists
and activation.file.missing. This change extends the same allowance to
activation.condition, which is a new Maven 4.0.0 feature that also needs
to reference the project base directory for its expressions.

This fixes a false positive warning when using expressions like
exists("${project.basedir}/src/main/java") in activation conditions.

(cherry picked from commit fde7213)
@gnodet

gnodet commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
master

Questions ?

Please refer to the Backport tool documentation

gnodet added a commit that referenced this pull request Dec 9, 2025
…1531)

Previously, ${project.basedir} was only allowed in activation.file.exists
and activation.file.missing. This change extends the same allowance to
activation.condition, which is a new Maven 4.0.0 feature that also needs
to reference the project base directory for its expressions.

This fixes a false positive warning when using expressions like
exists("${project.basedir}/src/main/java") in activation conditions.

(cherry picked from commit fde7213)
@gnodet gnodet modified the milestones: 4.0.0, 4.0.0-rc-6 Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mvn40

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants