PowerShell and Maven

I'm not normally a big PowerShell user, but the new version in the Windows 10 beta is pretty nice. It has some new tricks like coloring various bits of syntax and stuff like that. Also, it defaults to something that looks like a cmd.exe prompt.

Anyway, I've been using it recently instead of cmd.exe, but I did run accross a peculiar behavior when using Maven to build out some Java projects. Namely that you must enclose any -Dparameter=value statements in double quotes or you get errors.

For example:

mvn archetype:generate "-DarchetypeArtifactId=maven-archetype-quickstart" "-DgroupId=com.microsoft.example" "-DartifactId=EventCorrelation" "-DinteractiveMode=false".

Figured this might be useful to some of you.



Comments (0)

Skip to main content