Apache Maven (Maven) is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
Why Maven?
Let’s learn about the Maven’s history here https://maven.apache.org/background/history-of-maven.html to understand why Maven is created.
There are a lot of useful things that we should use Maven. In my opinion, the most important thing is that Maven solves the problems with managing jar files. It centralizes these files in one place and it is easy to use by declaring dependencies in a xml file (pom.xml).
Using Maven to manage JAR files
Firstly, I would like to give you an example about using some JAR files without Maven.
In my project, I need some JAR files such as SNMP4J.jar, jta26.jar, jgraphx.jar, etc… so I had to search them on the Internet with visiting a lot of websites, download and add these files into my project.
My example project was created with Eclipse (Kepler version) likes that:
It might be a little hard work because of trusted location, version, time to search, etc.
Now, we will use Maven. In Eclipse, create a maven project with “maven-archetype-quickstart”. Then, visit the maven repository website to look up my dependencies. http://mvnrepository.com.
Next, add to “pom.xml” file, like this:
If any JAR file cannot find from the Maven repository we have to add the jar file as common way. J
Okay, now we can manage the JAR files easier with Maven.
Okay, now we can manage the JAR files easier with Maven.
---
Reference: