Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't understand what Maven is all about, looking at the formal definitions

I am a very beginner to Java, recently trying to use some existing libraries and suddenly Maven came out in between. I am getting no idea reading the project page on Apache website, what maven is all about.

What is it required for? I am using some a library which asks me to install Maven and some further steps but I have no idea what is it for. Some places I see, it is for automating the process of building, but I can do that easily through NetBeans as well.

Any simple explanations shall be highly appreciated.

EDIT: Thank you all so much!

Please also clarify that if a library that I am using contains a .pom file what does it mean for me. I am building a web-application using some libraries most of which contain .pom files. What does it tell me to do? Does it force me to use Maven?

like image 558
Rajat Gupta Avatar asked Sep 08 '25 12:09

Rajat Gupta


1 Answers

Maven is an opinionated build tool and dependency management system.

  • build tool: it handles the process of turning your .java files into .class files, possibly transforming your resources and packaging everthing in .jar or .war or .ear or .tar.gz or .zip files. In this aspect it's similar to Apache Ant.
  • dependency management: it handles dependencies: it downloads required libraries, makes sure transitive dependencies (i.e. dependencies of dependencies) are downloaded as well, handles conflicting version numbers in dependencies (usually by trying to find a library that fits all requirements). In this aspect it's similar to Apache Ivy.
  • opinionated: it comes with some default configuration that specifies the layout and build process of your project. While it can be customized extensively, this customization can become hard to do. Following the suggested defaults makes using Maven easier, usually.

A key concept in maven is the POM, which contains everything Maven knows about your project. It is found in the pom.xml file. That file is also the best indication that a project uses Maven.

like image 148
Joachim Sauer Avatar answered Sep 10 '25 05:09

Joachim Sauer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!