This tutorial is a brief introduction to MAVEN, we’ll look at what MAVEN is and we’ll also learn how to set up MAVEN.
So what is MAVEN?
Maven is a build / project management tool, based on the concept of a project object model (POM) contains information of project and configuration information for the maven to build the project such as dependencies, build directory, source directory, test source directory, plugin, goals etc.
Maven defines a standard way to build the projects, test, and deploy project artifacts. It provides a framework that enables easy reuse of common build logic for all projects following Maven's standards.
To answer that question in a single sentence is not possible because MAVEN is a lot of things put into one. Most and common usages of MAVEN are…
1) Build tool (Similar to ANT in this case for example)
2) Project management tool is one other role played by MAVEN. It helps to generate reports, it helps in dependency management.
Let’s focus right now on MAVEN as a build tool. To look at what MAVEN does for us as a build tool, let’s try to identify the need for MAVEN.
Common problems and activities:
1. Problem of multiple jars – let’s say we are using a couple of frameworks in our code, for instance selenium server, testNG , JXL or POI library etc. In order to use these frameworks within my application I need to include all the required jars in my application, I need to make them available. Let’s say we are developing a scripts for web application I need to make sure those jars are available during compile time, I need to bundle them in my distribution when am deploying it. I need to know what those jars are. That’s one of the common problems that we face sometimes. Sometimes we miss out on some jars, sometimes we don’t know what jars are needed. So MAVEN helps us on this aspect.
2. Dependencies and Versions – Let’s say we have a particular jar and that jar has a dependency on other jar. Then I need to make sure that all my dependencies are closed, I need to make sure I have supplied all the required dependencies.
These are few of the common problems that we face while architecting, developing, compiling and executing scripts on a web application. So MAVEN helps us by providing very elegant solutions to each of these problems.
Before we start on exploring more on MAVEN, let’s take a quick look on how to set up a MAVEN