“Maven is a project management tool which encompasses a project object model, a set of standards, a project lifecycle, a dependency management system, and logic for executing plugin goals at defined phases in a lifecycle”
Maven is a build tool based on JAVA Files.
Main Features:
- Build-tool
- Dependencies management tool
- Documentation tool
Maven Life Cycle:
- Generate Resources
- Compile
- Test
- Package
- Install
- Deploy
- Generate Resources :
- Compile: It is a phase where it will compile all java files will be converted to object files.
- Test: Maven will try to do Unit Test i.e., a particular test what developer does to check if the code is running fine.
During test it will create a “test.Java” file and the compiles to “test.class” file then the test is done. - Package: Is a assembly step where it create a deliverable file.
e., Jar,war,ear files. - Install : It will take a copy of project output & copies into the local repository.
- Deploy : Taking the deliverable of a project and put into some particular location.
Environmental Variables:
Before using maven there has to be few environmental Variables that has to be set, which can be seen in below picture.
- We will have all the source file related to project in POM.XML.
- Anything that we are going to specify in Maven will be provided through Goals.
these goals will invoke a plugin, then the plugin will run the task. - Each and maven project should have a minimum of one POM.XML.
- XML should have
- G – Group ID
- A – Artifact ID
- V – Version ID
- Source Code location
- Specify certain plugin used in project
- Dependencies
- Xml should always begin with tag <project> and end with </project>
- There are two types of plugins:
- Build Plugin : using which we will do build activity (ex : install)
- Reporting Plugin: Any plugin used to generate reports (ex: Site)
Default POM.XML:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<project> <groupId> value </groupId> <artifactId> value </artifactId> <version> 1.2.3 </version> <build> <plugins> <plugin> <groupId> value </groupId> # What Plugin it is <artifactId> value </artifactId> <version> 1.2.3 </version> <executions> <execution> # when to use plugin <phase> value </phase> (Value : Test,complie etc.) <configuration> # what exactly the plugin has to do </configuration> </execution> </executions> </plugin> </plugins> </build> </project> |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform
Nikhil
Nice information
Krishna Prasad
I will feel happy for you
Pragnya
Very informative.
Goutham
Good info
Vibhusha Gupta
Very Nice. Good Information.
Vibhusha Gupta
Very Good Information.
Nagarjuna
Hey good Article
Harish
Thanks for intro to MAVEN
Ravi Shankar
Good stuff
pandu ranga
Very Good quality data
Gayatri
Good Data
sai
useful post
jerry
the posts are very useful. keep doing it. i am badly interested in working on this. thank you for this support