What is Apache Maven?

This articles discusses What is Apache Maven and how it is useful for the development of software projects.

What is Apache Maven?

What is Apache Maven? What is the importance of Maven in project development and deployment?

In this article we will introduce you with the Maven project management tool.

Apache Maven or simply Maven is project management tool which used by developers to manage the build, test and deployment process of software project. It comes with many plugins and reports for easily development and reporting of the complete software development process. Maven is very easy to use project management tools.

Apache Maven tool is mostly used for the development, building, testing, reporting and deployment of Java based applications. But is can also be used for the development of C, C#, Ruby, Scala and other programming languages. If is fast and very useful for developers and it can automatically download the libraries required for building and testing of the applications. It downloads the libraries from repositories on the Internet, but it can also be used to use the local library repositories.

Apache Maven popular build automation tool basically used for Java projects and is designed to make the build process easier then before. Maven is primarily similar to Apache Ant tool but is based on different principles and concepts and thus works differently from Ant. However, like Ant, maven can also be used for managing projects written in C#, Ruby, Scala, and other languages.

Maven was initially started in Jakarta Turbine project in order to simplify the build up process but now it is hosted by the Apache Software Foundation. The basic idea or objective behind developing Maven was to make the build process easy by providing uniform built system with quality project information. Moreover, Maven also provides best and easy guidelines for project development process and allows transparent migration to new features.

In order to build a software project, Maven uses XML file to describe the various aspects of the project like the build order, directories, and required plug-ins. Moreover, Maven has pre-defined targets to carry out certain well-defined tasks such as compilation of code and its packaging.

Apache Maven is quite easy to use as it automatically downloads Java libraries and Maven plug-ins from one or more repositories such as the Maven 2 Central Repository, and finally stores them in a local cache. In addition to that, Public repositories can also be updated in Maven.

Maven is created with the use of a plugin-based architecture, which allows it to utilize any application controllable through standard input. Moreover, it can be inferred that Maven allows anyone to write plugins to interface with build tools for any other language. However, support and use for languages other than Java are used very less.

Maven is configured using xml file and it is know as Project Object Model (pom.xml). Here is very simple pom.xml file example:

<project>
<!-- model version -->
<modelVersion>4.0.0</modelVersion>

<!-- Project details -->

<groupId>net.roseindia.myapp</groupId>
<artifactId>my-app</artifactId>
<version>1.0</version>

<!-- library dependencies -->

<dependencies>

<!-- Junit dependency -->
<dependency>

<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>


<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>


<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.6</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>

</dependencies>
</project>

View more Apache Maven 3 tutorials.