pom.xml, you say?
What does having this file mean? POM stands for Project Object Model, written in XML format. It should be ideally placed inside, the root directory of the project. It contains project resources like source code, test code, dependencies (external JARs used) etc. The POM contains references to all of these resources.
Maven: Build tool for Java software projects. You can build software projects using other languages too, but Maven is developed in Java, and is thus the obvious choice for Java projects. Passionate Maven developers claim, Maven goes beyond this, but for now, let’s keep limit it for simplicity sake to a BUILD TOOL. P.S: to read for more on the philosophy of the Maven!
A POM file tells you what to do, Maven has built-in dependency management which takes care of the how part. Here is a representation on how Maven uses the POM file, and what the POM file primarily contains:
Tags/meaning in the POM file:
<projectId>
: mention the name of the project here.<modelVersion>
: your project dependencies inside the element.<groupId>
: dependency is described by itsgroupId
,artifactId
andversion
. TheGroupId & artifcatId
are both set as the dependency name.<artifcatId>
: element contains the name of the project you are building.<version>
: Default value is “RELEASE” or you can specify the version restriction. This is specified for a specific dependency.<dependencies>
: Your project dependencies inside the element.<scope
can have these values depending on the usage level test/compile. This is specified for a specific dependency/artefact.