Basic of maven tool on Automation front



Basic of maven tool on Automation front


A build tool is a tool that automates everything related to building the software project. Maven, is an innovative software project management tool, provide new concept of a project object model(POM) file to manage project's build , dependency and documentation, this session is to target the beginners in helping them understand the basic of maven tool on Automation front

 Why Automation Build Tool 

  1. Accelerate the compile and link processing.
  2. It will minimize the human errors while building a software.
  3. Reduce redundant tasks.
Maven is a 
  1. Building tool.
  2. Dependency management tool
  3. Project management tool  
Core concept in Maven depends on following points 
  1. Dependencies and repositories 
  2. Build Life Cycle 
  3. Phases
What is Dependencies

Dependencies are required jars which are required to build the project.
Include all Jars and plugins in project.

Maven Repository 

3 types of maven repository 
  1. Local Repository : Local repository is a folder location in development machine and it gets crated when you run any maven command for the first time. (By default folder name is .m2)
  2. Central Repository : Maven central repository is repository provided by Maven community. It contains a large number of commonly used libraries.  http://repo1.maven.org/maven2/
  3. Remote repository :Some time maven dose not find required file in central and due to this build process gets failed.  To overcome this problem Maven provides concept of Remote Repository which is developer's own custom repository containing required libraries or other project jars.  
Sample POM for Remote repository 

how to use Remote repository in POM

Build Life Cycle

Maven has mainly 3 build in life cycles
  1. Clean
  2. Site
  3. Default
What is POM 
A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project
  • Maven reads POM file to build the project. 
  • Specifies project information, plugins, goals, dependencies and profiles. 
Sample POM 


Sample pom for cucumber


Sample project structure for Maven project  


maven project sample

In my next post I'll explain how to configure MAVEN project and sample selenium maven project. 

Share this

Related Posts

Previous
Next Post »