There is no lifecycle start command based on a lifecycle name. Thus, you cannot make mvn Default and expect it to work before Default:deploy . You should mention a loop task such as test , package , clean , and the life cycle to which this task belongs will become active.
It makes no sense to have a life cycle as an argument. This will be confusing. For example, running mvn clean is a clean life cycle or a clean task?
Or, it will be more verbose to type mvn clean clean life cycle will work; and mvn clean:clean will run a cleanup cycle until clean .
Maven has three life cycles. Executing a task (for example, task_N) of any life cycle will lead to the execution of the entire life cycle before this task (task_N). Three life cycles: Clean, Default, and Site.
For more information, see Introduction to Maven Life Cycles and Task Order.
You see, when you execute say, mvn test are things that are executed in this order
validate> initialize> generate-sources> process-sources> generate-resources> process-resources> compile> process-classes> post-process> generate-test-sources> process-test-sources> generate-test-resources> process- test-resources> test-compile> process-test-classes> test
You cannot skip any tasks by default. You can connect plugins that are obtained during the execution of the task.
source share