Invalid task ‘.test.skip=true’: you must specify a valid lifecycle phase […]

Problem

When running maven command with a parameter starting with ‘-‘ from powershell, for example

mvn -Dmaven.test.skip=true install

An error like this one may ocurr:

[INFO] Invalid task '.test.skip=true': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId :pluginVersion:goal

Solution

It is something related to the encoding of the minus sign in power shell. The solution is to escape it with a backtick (`) symbol. For example,

mvn `-Dmaven.test.skip=true install

Reference

http://www.mail-archive.com/users@maven.apache.org/msg83991.html

Advertisements

One thought on “Invalid task ‘.test.skip=true’: you must specify a valid lifecycle phase […]”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s