Search code examples
mavenlifecycle

How to invoke maven default lifecycle


If i call

mvn clean install

maven knows that clean is a lifecycle and install is a phase of the default lifecycle

if i call

mvn deploy

maven will execute all phases of the default lifecycle sequentially.

Is there a way to call the default lifecycle by giving a lifecyle name (instead of executing the last phsae of the lifecycle)?

EDIT: So the question is: is there a command

mvn lifecyclename

that start execution of the default lifecycle?


Solution

  • There seems to be a misunderstanding. Further reading could clarify that

    mvn clean
    

    does not invoke the whole clean lifecycle. In fact there is a clean phase in the clean lifecycle. And the command executes this phase and not the lifecycle.