Skip to content

Adapt ITs for restricted interpolation of repository-resolved models - #440

Merged
gnodet merged 1 commit into
apache:maven-3.10.xfrom
gnodet:fix/restricted-interpolation-system-path
Sep 3, 2026
Merged

Adapt ITs for restricted interpolation of repository-resolved models#440
gnodet merged 1 commit into
apache:maven-3.10.xfrom
gnodet:fix/restricted-interpolation-system-path

Conversation

@gnodet

@gnodet gnodet commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Maven 3.10.x commit 03c947d820 restricts property interpolation for models built at VALIDATION_LEVEL_MINIMAL (dependency, parent and BOM-import POMs). User, system and environment properties are no longer resolved in those models by default.

The existing integration tests for system-scope dependencies in repository-resolved models were not updated to account for this new behavior, causing 4 ITs to fail:

  • MavenIT0085TransitiveSystemScopeTest
  • MavenITmng3586SystemScopePluginDependencyTest
  • MavenITmng4379TransitiveSystemPathInterpolatedWithEnvVarTest
  • MavenITmng4590ImportedPomUsesSystemAndUserPropertiesTest

This PR adapts the tests by:

  1. Adding -Dmaven.model.dependencyInterpolation.full=true to the existing test methods so they continue testing the full-interpolation behavior
  2. Adding new test methods gated with matchesVersionRange("[3.10.0,)") that verify the new default (restricted) behavior: when the opt-out is not set, the build should fail because systemPath expressions remain unresolved

This matches the approach taken for the in-tree ITs on master/4.0.x in commit 3c097358a5.

@gnodet
gnodet force-pushed the fix/restricted-interpolation-system-path branch 5 times, most recently from 45d7925 to 8695d55 Compare September 3, 2026 09:22
Maven 3.10.x commit 03c947d820 restricts property interpolation for
models built at VALIDATION_LEVEL_MINIMAL (dependency, parent and
BOM-import POMs). User, system and environment properties are no
longer resolved in those models by default.

Each of the 4 affected ITs (IT0085, MNG-3586, MNG-4379, MNG-4590) is
updated with:

1. A version-gated branch in the original test method: on 3.10.0-rc-1
   or earlier, the test expects the old behavior (full interpolation
   without opt-out); on later versions, it verifies that the build
   fails without the opt-out flag.

2. A new test method that explicitly passes
   -Dmaven.model.dependencyInterpolation.full=true and verifies the
   opt-out works correctly on all versions.

Since AbstractMavenIntegrationTestCase.removePattern() strips RC
qualifiers (both rc-1 and rc-2 become 3.10.0), the version guard
uses a combination of getMavenVersion().toString().equals("3.10.0-rc-1")
and matchesVersionRange("(,3.10.0)") to correctly distinguish rc-1
from later versions.
@gnodet
gnodet force-pushed the fix/restricted-interpolation-system-path branch from 8695d55 to c6c5eb0 Compare September 3, 2026 11:44
@gnodet
gnodet merged commit 410700f into apache:maven-3.10.x Sep 3, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant