You are on page 1of 4

maven : build tool.

maven ==>>> apache.

Developers ==>> code ==>> push ==>> github ===>>> code ==>> maven ==>> build tool
==>> build ==>>> package ===>>> war / jar / ear ===>>copy ==>> tomcat
( webserver)===>> APP ==>> EU.

Maven is worked for java based projects only..

Maven ===>>> alternative tool ==>> ANT ( build tool ==>>> older tool )

******* maven vs ant*****************

MAVEN : build tool

1. works for java based projects only

2. maven has life cycle.

3. maven works for project object based model.===>> maven ==>> pom.xml

4. defaultly junit test cases run..

5. maven has plugins ==>> plugins ==>> install ==>> extranal features adding to our
project.

plugins are reusable.

6. maven checks the dependencys..

ANT : build tool

1. works for java based projects only

2. Ant has no life cycle.

3. ANT has build.xml

4. Ant does not checks junit test cases.

5. ant has scripts. ==>>> scripts are not reusable.

6. Ant does not checks dependencys..

===================================================================================
===================

maven works for project object based model..

maven ==>> pom.xml

pom.xml ==>> file ==>> written by developers..

Every project has one pom.xml

pom1.xml or pom.xml2
pom.xml should be unique name.==>> pom.xml

pom.xml has the fields

groupid ==>> clientname or projectname ==>>> SBI

artifactid ==>> feturename ==>> Creditcard

versionid ==>> threefields ==>> majorrelease.minorrelease.hotfix/bugfixrelease


==>>> 8.2.0

typeofpackage ==>>> war/jar/ear

properties ===>>>> sonarqube url link ( ops team)

dependencys ==>> 1.8 ===>> 1.7

distribution management ==>>> nexus url ===>> ( ops team)

plugins..

maven has in built one pom.xml ==>>> superpom / parentpom

superpom ==>> propeties are inherit to normal pom.xml ( develeper ===>> developed
pom.xml).

===============================================================

maven searching way : 3 types..

1. central repository ===>>> online

2. remote repository ==>> organization level ==>>> IBM ( real time)

3. local repository ==>> our ownlaptop.

=====================================================================

maven lifecycle.

1. default

2. clean

3. site

===>1. default :

1. compile

2. validate.

3. test

4. package

5. install

6. verify
====>>>2. clean

1. preclean

2. clean

3. postclean

====>> 3. site :

1. presite

2. site

3. postsite

4.site-deploy

maven goals or maven commands..

maven commands starts with mvn

mvn compile

mvn compile verify clean

mvn test install package site

mvn clean package

Note and Keypoint : maven always looks for pom.xml

every command / goals you need type in maven ===>>> always looks for pom.xml in
current directory..

=============================================================

maven ===>> relases and snapshots..

releases ==>>

pom.xml ==>>> versionid ==>>> 8.2.0 ===>> it is going to release.

releases are mainting the versioning..

snapshots ==>>>

pom.xml ==>>> versionid ==>>> 8.2.0-SNAPSHOT ===>> it is in under developement


process.

snapshots are not mainting the versioning..

===================================================================================
============================

maven installation steps :

1. we need to take one ec2 instance and login into the ec2instace.
2. we need to install java.

3. we need to install git

4. cloning the githuburl ===>> git clone githuburl..

5. we need to install maven ( 3 steps )

6. cd myweb

7. mvn clean package

ls

in target directory ==>> war file will generate. ===>>myweb-8.2.0.war

===================================================================

*********** maven home directory ==>> /usr/share/apache-maven *********

=======================================================================

You might also like