maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

mvnd fails to run through powershell

Open bonepl opened this issue 2 years ago • 7 comments

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)

bonepl avatar Jul 03 '23 11:07 bonepl

mvnd stopped working

Did it work (which mvnd version?) for you before?

ppalaga avatar Jul 03 '23 13:07 ppalaga

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.

bonepl avatar Jul 03 '23 14:07 bonepl

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?

ppalaga avatar Jul 03 '23 15:07 ppalaga

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.

bonepl avatar Jul 04 '23 09:07 bonepl

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?

ppalaga avatar Jul 04 '23 09:07 ppalaga

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

bonepl avatar Jul 05 '23 08:07 bonepl

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.

gnodet avatar Jul 05 '23 09:07 gnodet