Maven
Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages.
Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages.
Build = Compile + Assemble + Create Deliverable
Compile = Compile Source code to machine readable format
Assemble = Grouping all class files
Deliverable = war.jar
Main configuration file - pom.xml
pom.xml contains:
Metadata
Dependencies
Kind of project
Kind of output
Description
Maven Build life Cycle:
Generate Resources(Dependencies)
Compile code
Uit Test
Package(Build)
Install
Deploy
Clean
Plugins
Maven integration
Maven invoker
Installation in Linux
cd /opt
wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
tar -xvzf apache-maven-3.8.6-bin.tar.gz
mv apache-maven-3.8.6 maven
vi /root/.bash_profile //setup environment variables,
M2_HOME=/opt/maven
m2=/opt/maven/bin
PATH=$PATH:$JAVA_HOME:$M2_HOME:$M2
mvn archetype:generate //It download lot of templated from maven repository
mvn archetype:generate | grep maven-archetype-webapp //Note down the template ID, so we can use it with the above command
groupid: in.saidemy.webapp
artifactid: webapp-project
ls