EN
Maven - fix for [ERROR] Unknown lifecycle phase ".test.skip.exec=true". You must specify a valid lifecycle phase or a goal in the format
7
points
Hi, today we would like to show how to fix the unknown lifecycle phase error when using maven on Windows.
Problem
When I tried to execute some commands with define a system property (-D parameter) and I get error:
PS C:\projects\examples> mvn clean install -Dmaven.test.skip.exec=true
[ERROR] Unknown lifecycle phase ".test.skip.exec=true". You must specify a valid lifecycle phase or a goal in the format
In this example I use maven.test.skip.exec
parameter: -Dmaven.test.skip.exec=true
.
This problem occurs not only for this parameter but for some other parameters also.
Solution
I found the solution for this problem.
The fix is quite simple, on Windows we just need to add back quote sign before -D parameter.
Example:
`-D
Full working command line:
PS C:\projects\examples> mvn clean install `-Dmaven.test.skip.exec=true
It turned out that it is platform dependend problem.
It occurss only on Windows.
Linux and MacOS it works without back quote sign.