Lifecycles Reference

Maven defines 4 lifecycles in org.apache.maven.lifecycle.providers package:

default Lifecycle

default lifecycle is defined only with phases, without any associated plugin binding: plugins bindings for this lifecycle are defined separately for each packaging:

  1. private static final String[] PHASES = {
  2. "validate",
  3. "initialize",
  4. "generate-sources",
  5. "process-sources",
  6. "generate-resources",
  7. "process-resources",
  8. "compile",
  9. "process-classes",
  10. "generate-test-sources",
  11. "process-test-sources",
  12. "generate-test-resources",
  13. "process-test-resources",
  14. "test-compile",
  15. "process-test-classes",
  16. "test",
  17. "prepare-package",
  18. "package",
  19. "pre-integration-test",
  20. "integration-test",
  21. "post-integration-test",
  22. "verify",
  23. "install",
  24. "deploy"
  25. };

clean Lifecycle

clean lifecycle phases are defined with their plugins bindings:

  1. private static final String[] PHASES = {
  2. "pre-clean",
  3. "clean",
  4. "post-clean"
  5. };
  6.  
  7. private static final String MAVEN_CLEAN_PLUGIN_VERSION = "3.1.0";
  8.  
  9. private static final String[] BINDINGS = {
  10. "clean", "org.apache.maven.plugins:maven-clean-plugin:" + MAVEN_CLEAN_PLUGIN_VERSION + ":clean"
  11. };

site Lifecycle

site lifecycle phases are defined with their plugins bindings:

  1. private static final String[] PHASES = {
  2. "pre-site",
  3. "site",
  4. "post-site",
  5. "site-deploy"
  6. };
  7.  
  8. private static final String[] BINDINGS = {
  9. "site", "org.apache.maven.plugins:maven-site-plugin:3.9.1:site",
  10. "site-deploy", "org.apache.maven.plugins:maven-site-plugin:3.9.1:deploy"
  11. };

wrapper Lifecycle

wrapper lifecycle phases are defined with their plugins bindings:

  1. private static final String[] PHASES =
  2. {
  3. "wrapper"
  4. };
  5.  
  6. private static final String[] BINDINGS = {
  7. "wrapper", "org.apache.maven.plugins:maven-wrapper-plugin:3.1.0:wrapper"
  8. };