maven icon indicating copy to clipboard operation
maven copied to clipboard

[MNG-8672] Maven 4 CLI substitutes variable when single quoted

Open jira-importer opened this issue 8 months ago • 5 comments

Alexis Tual opened MNG-8672 and commented

When executing this command line:

 

placeholder=foo mvn clean verify '-DsomeProp=${placeholder}'

 

Then we get:

  • Maven 3:  someProp equals to ${placeholder}

  • Maven 4.0.0-rc-4-SNAPSHOT (5426073a3655278e58f8a4178faae335b1544fc0) :  someProp equals to foo

The single quote implies the variable should not be substituted, in that sense Maven 3 seems to be the correct behavior.

It's due to this change


Affects: 4.0.0-rc-4

jira-importer avatar Apr 03 '25 12:04 jira-importer

Michael Osipov commented

I knew that the offending change is a problem.

jira-importer avatar Apr 03 '25 15:04 jira-importer

Alexis Tual commented

I've fixed the bug description to reflect what we see in our regression tests. We don't know if it's a use case or not; we can adapt our tests, but we just wanted to report this regression.

jira-importer avatar Apr 04 '25 07:04 jira-importer

@michael-o What is the state here? Can this be fixed for the upcoming Maven 4 RC version as it's a regression?

guylabs avatar Sep 12 '25 13:09 guylabs

@michael-o What is the state here? Can this be fixed for the upcoming Maven 4 RC version as it's a regression?

I can't tell you. I stopped working on Maven Core more than a year ago and lost complete track.

michael-o avatar Sep 12 '25 19:09 michael-o

@michael-o What is the state here? Can this be fixed for the upcoming Maven 4 RC version as it's a regression?

@gnodet @cstamas any insights on this?

alextu avatar Sep 15 '25 08:09 alextu