The command below works in command line
mvn clean install -Denunciate.skip
But breaks in powershell with the error
[ERROR] Unknown lifecycle phase ".skip". You must specify a valid lifecycle phase or a goal in the format
Using quotes can help, especially with actual PowerShell code. However you are just trying to use a regular command. You can keep the PowerShell parser from misinterpreting your code by using the stop-parsing parameter
The stop-parsing symbol (
--%
), introduced in Windows PowerShell 3.0, directs Windows PowerShell to refrain from interpreting input as Windows PowerShell commands or expressions.When calling an executable program in Windows PowerShell, place the stop-parsing symbol before the program arguments. This technique is much easier than using escape characters to prevent misinterpretation.
So for your command you could have also done this.
mvn --% clean install -"Denunciate.skip"
If you did have variables mixed in there then just move the stop parser as needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With