TestingDocs.com
Software Testing website
  • JBehave
  • Selenium
  • Testlink
  • Maven
  • Git
  • RAPTOR
  • Questions

What is Maven?

Tweet
Pin it

Document Contents

  • Introduction
  • Installing Apache Maven
  • Environment variables
  • Project Object Model
  • Sample POM

Introduction

Apache Maven is a build automation tool. It is popularly used for build automation, dependency management, project life-cycle, continuous integration. One of the best features of Maven compared to the Ant tool, is that it will discover the dependency artifacts automatically.

Apache Maven is a tool for building software. It is configured with a POM (Project Object Model ) file. It runs in JVM and uses a distributed repository model. ( plugins and dependencies are kept in remote repositories ).

Installing Apache Maven

The only prerequisite for installing the tool is Java JDK. Installing maven is very easy, download and extract the tool into a folder and set the environment variable.

  • Download from the Official site: http://maven.apache.org/

Detailed information on how to set up Maven is at:

https://www.testingdocs.com/installing-apache-maven-3-x-on-windows-10/

Environment variables

Configuration of environment variables

  • JAVA_HOME: Points to installation location for the JDK installation.
  • M2_HOME: Points to the home directory for Maven
  • PATH: Unix appended the following to existing path  ${JAVA_HOME}/bin and ${M2_HOME}/bin
  • Windows appended the following to existing path   % JAVA_HOME%\bin and %M2_HOME%\bin

 

Project Object Model

The important file in the Maven project is pom.xml ( Project object Model ). Every project contains this file. POM is an XML file that contains information about project and configuration details used by Maven to build the project.

● The XML file pom.xml contains details about the project, dependencies
● POM may be hierarchical i.e it can have a parent POM and child POMs for a given project.
● Defines project identity, dependencies, plugins, repositories, parent POM, modules, properties, and many more.

 

Maven POM Editor

Creating a simple maven project via command line or through Eclipse/IntelliJ IDEA IDE.

I have created a sample project through the following command to show in the post. Generally, Choose the IDE to create a quick maven project.

/> mvn archetype:generate -DgroupId=com.testingdocs.sample  -DartifactId=SampleProject

Sample POM


<project xmlns=”http://maven.apache.org/POM/4.0.0” 
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” 
 xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd”> 
 <modelVersion>4.0.0</modelVersion> 
 <groupId>com.testingdocs.sample</groupId> 
 <artifactId>Sample</artifactId>  
<version>1.0-SNAPSHOT</version> 
<packaging>jar</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>

 

Maven Tutorials on this website can be found at:
https://www.testingdocs.com/apache-maven-tutorial/

For more details on the Apache Maven, visit the official website at:
https://maven.apache.org/

Related Posts

Apache Maven /

Maven Project from Archetype

Apache Maven /

Creating a Maven project using NetBeans IDE

Apache Maven /

Create a Maven Project skip archetype

Apache Maven /

Install Maven on Ubuntu Linux

Maven Archetype plugin command line

Apache Maven /

Maven Archetype plugin command line

Tag Cloud

Agile Appium Tutorials C++ Eclipse Tutorials Git Tutorials IntelliJ Tutorials Java Java Tutorial JBehave Jenkins Jira Cloud JUnit Tutorial Maven Object-oriented Flowchart Python Tutorials Raptor Flowcharts Selenium IDE TestLink Tutorials

Random Posts

  • TestLink Bitnami Cloud Image
    Overview In this tutorial, we will see the steps

    Read more

  • Code Coverage Tools
    Overview Let’s look at some of the code coverage

    Read more

  • pCloudy Continuous Testing Cloud
    Overview pCloudy is a continuous testing cloud

    Read more

Latest Tweets

Tweets by @TestingDocs

Back to Top

TestingDocs.com

  • Privacy Policy
  • Cookie Policy
  • JBehave
  • Selenium
  • Testlink
  • Maven
  • Git
  • RAPTOR
  • Questions
www.TestingDocs.com | All Rights Reserved