Why I am asking about Maven POMs? I do know, honest. But I often read blog posts or articles about Maven and wonder about the language being used. There’s some very domain specific terms in use here. So I decided to offer some definitions for people starting out with Maven.
The Project Object Model is a description of your project; it is exactly a model, as stated in its name, it is the breakdown of all the elements of your application: dependencies, repositories, SCM connectors and so on. In a POM you never implement the behavior, you just configure it, using a set of predefined conventions (like src/main/java for sources, src/site for documentation …) The POM acts as a template to finally generate an *Effective POM* which expresses all the executions of all the plugins that must take place during the build.
So a POM is telling you about every major entity in the project. Which Maven needs to know about in order to build the project. I’d summarise a POM as a kind of manifest or packing slip.
Cue man in blue coat:”Yeah, it’s all here. 5 source trees, two version control systems and a bunch of Selenium tests. We ought to have that built by Wednesday.“
The POM is one of the biggest evolutions that Maven contributed to the build tooling universe; in the past we were used to implement the behavior of the build; now we describe the prerequisites, assuming that we know what the behavior is, tweaking it a little bit with some configuration.
Which is a really interesting point. If you think Ant or one of it’s ports is a declarative tool, wait until you see a Maven POM file.
Image by Tavallai