Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvnd fails to run through powershell #865

Open
bonepl opened this issue Jul 3, 2023 · 7 comments
Open

mvnd fails to run through powershell #865

bonepl opened this issue Jul 3, 2023 · 7 comments

Comments

@bonepl
Copy link
Contributor

bonepl commented Jul 3, 2023

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)

@ppalaga
Copy link
Contributor

ppalaga commented Jul 3, 2023

mvnd stopped working

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

@bonepl
Copy link
Contributor Author

bonepl commented Jul 3, 2023

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.

@ppalaga
Copy link
Contributor

ppalaga commented Jul 3, 2023

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?

@bonepl
Copy link
Contributor Author

bonepl commented Jul 4, 2023

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 bonepl closed this as completed Jul 4, 2023
@ppalaga
Copy link
Contributor

ppalaga commented Jul 4, 2023

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 ppalaga reopened this Jul 4, 2023
@bonepl
Copy link
Contributor Author

bonepl commented Jul 5, 2023

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

@gnodet
Copy link
Contributor

gnodet commented Jul 5, 2023

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.

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

No branches or pull requests

3 participants