I have created another example to demonstrate how to override default Maven build lifecycle. Default build lifecycle is used to construct your software project, for example, it is executed when you run mvn install in a jar type project.

You can find source code example at https://github.com/carlosvin/lifecycle-maven-plugin.

Tip
I’ve also created an archetype so you can easily play with the example.

Create an example project

Generate the project using archetype
mvn archetype:generate \
  -DarchetypeGroupId=com.github.carlosvin.archetype \
  -DartifactId=lifecycle-maven-plugin-archetype \
  -DarchetypeVersion=0.6