mvnd fails to run through powershell
Hi,
mvnd stopped working for my project as it throws
[ERROR] Unknown lifecycle phase "". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]
when I'm trying to run it through my powershell script:
& $mvn_executable install -DskipTests $profiles "-Dsource.skip=true" -nsu $verbose $threads "-Dmaven.javadoc.skip=true"
where $mvn_executable is either mvn or mvnd
standalone mvn works fine from the script mvnd command run from terminal works fine
mvn version: 3.9.3 mvnd version: 1.0-m6 powershell version: 7.3.4
any idea why it started to behave that way (it worked fine some time ago)
mvnd stopped working
Did it work (which mvnd version?) for you before?
As I have scripts that keep mvnd binaries up to date - hard to tell. I know that this probably won't be much helpful but definitely worked one year ago.
Not sure how escaping of $foo placeholders works in PowerShell, but do you happen to pass some special chars via some of those ? Would enclosing them in quotes "$foo" change anything?
okay, I debugged stuff more - something doesn't work between powershell and mvnd - some double quotes were passed "as is" to executable. It looks like mvn just drops "" arguments but mvnd tries to parse them as phases.
Thanks for feedback anyway.
It looks like mvn just drops "" arguments but mvnd tries to parse them as phases.
This is interesting. I think we'd be interested to behave in the same way as stock Maven. WDYT, @gnodet?
I'm pasting powershell scripts that recreate this behaviour
This works:
$test_param = ""
mvn clean $test_param
This fails:
$test_param = ""
mvnd clean $test_param
It looks like mvn just drops "" arguments but mvnd tries to parse them as phases.
This is interesting. I think we'd be interested to behave in the same way as stock Maven. WDYT, @gnodet?
Definitely.