From the course: Introduction to Maven
The POM file - Maven Tutorial
From the course: Introduction to Maven
The POM file
- [Instructor] Now that we've talked about Maven in general and the Java project structure, it's time to get to the heart and soul of Maven, and that is the POM.xml file. Often you'll hear a Java developer who has experience with Maven tell you to do something to the POM file, but you may be asking what it really is. The POM file is an acronym for Project Object Model. It contains all of the details about the project, including its dependencies, information about the build details, and any reporting or deployment details that may be specified for the project. The project information is top level details of the project. This includes item like the group this project belongs to. This is an organizational unit in a Maven repository and often corresponds to the root package of your project. It also includes the project or artifact identifier. This is the common name of your project. Version is also included in the project information. Most often developers use semantic versioning for Maven projects, but there is also often qualifiers like snapshot or release, which varies from project to project, and each of them often has specific meaning. There are a lot of other sections in the POM file and we are going to talk about them individually as we go through this course. As such, I just want to introduce them here at a very high level. Properties are often underutilized, but very important in both small and large projects. And I'll give you some examples of why. Dependencies and the associated dependency management sections are what most people immediately think about with Maven POM Files. This is where we specify all of the dependencies that our project needs in order to compile. There's also a build section that defines plugins used to build your project. And again, we're going to go through these details. And finally, there is the report section, which indicates how to report information about your project. Now, there are a couple of sections we aren't going to talk about, but they are important in their own right. These tend to be organization specific instead of project specific, but not always. They include repositories, which point to Maven repositories for artifacts where usually you are storing your artifacts or where you want Maven to go to instead of Maven Central, so you don't get throttled as a company. Plugin repositories, which as you might imagine, point to pluggage used by Maven itself. Again, often we're going to use these with a detached version that mirrors Maven Central so that we don't get throttled. And then there are profiles which allow for overrides of configuration and provide default behavior for common tasks. These are all outside the basics of this course because as I said, they're organization specific most of the time. We're now ready to dissect the most important sections of the POM file.