Languages
[Edit]
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
Created by:
Frank-van-Puffelen
439

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.

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join