I am trying to build our web project from the commandline but skipping the testing. I am using the command mvn clean install -Dmaven.test.skip=true.
Whe
The following works for me.
$mvnArgs1 ="mvn test -X -Dmaven.test.skip=true".replace('-D','`-D')
Invoke-Expression $mvnArgs1
It looks like the -D is a kind of a special character and requires escaping.
Note also that –X works fine and does not require escaping.
Note the use of single quote in the replace command, if you use double quotes (i.e. ") you need to use ``.
I am using Powershell 2.0 (2.0.1.1) on windows 7