How Maven Lifecycle Rose to The #1 Trend on Social Media

Maven:

The Maven build follows a specific life cycle to deploy and distribute the target project.

Default: the main life cycle as it's responsible for project deployment
Clean  : To clean the project and remove all files generated by the previous build
Site     : To create the project's site documentation

Related Topics

Default: Phase

validate: Validate the project is correct and all necessary information is available

compile : Compile the source code of the project

test       : Test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.

package: Take the compiled code and package it in its distributed format, such as a JAR.

verify    : Run any checks on results of integration tests to ensure quality criteria are met.

install   : Install the package into the local repository, for use as a dependency in other projects locally.

deploy   : Done in the build environment, copies.



Execute Projects: 

1. Standalone-jar 

   mvn clean package or
   mvn clean package -DskipTests
   mvn clean package -Dmaven.test.skip=true
   
  cd java-project
  mvn package
  java -jar target/java-project-1.0-SNAPSHOT.jar 123456
 
2. Web -war 
   make sure that packaging as a war in pom.xml file.
 
3. Enterprise 
   download on example and execute 

See Also: 

Chandra Sekhar

A Blogger and Author! This post was written and edited by me, a technologist. I started this site to share my inspirations, work, and free materials, which I hope others may find useful as well. Man with a creative streak who enjoys experimenting with various web design strategies.

Previous Post Next Post

Microservice Communication in a Distributed System