Maven commands which has -D options does not work for me. I tried running command
mvn clean install -Dmaven.test.skip
and get error message as
[ERROR] Unknown lifecycle phase "?Dmaven.test.skip". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: 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-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]`
When I copied the same command in a batch file & tried calling the batch, it ran successfully. Below are the environment details Operating System : Windows 7 JDK : 1.8.0_40 Maven : 3.3.1
I tried running in MS Dos & Powershell, but getting same error in both the places. I felt it is because of some character encoding, not sure. Please suggest.
I could finally figure out based on all the trials which were suggested by Tome , Assylias, Manish Thank a lot. The output of command was not consistent as "dash" was giving problem as it sometimes becomes a weird character when copied from a file. Also when I was typing the command, sometimes it works & at times it was failing (probably because of some command was executed from history). So then I deleted all previous commands & started typing every other time & it worked perfectly.