1

The article Maven, not just another build tool claims that *Maven brings the object oriented approach to the build tools table. I'm completely failing to see how. Actually, I see neither any OO concept there, nor anything I'd call an object.

I'm not starting another rant here, I'm just asking how this claim can be supported.

Community
  • 1
  • 1
maaartinus
  • 44,714
  • 32
  • 161
  • 320

2 Answers2

0

Maven modules can inherit from other maven modules, though what they inherit tends to be instructions for building and configurations of metadata, not the files that they apply those instructions to. Typically, the parent modules are done of type pom (i.e., without standard outcome artefacts), and container modules are also done that way. Indeed, containers are often also parents, even though I suspect that's not that great a way to do things (though the containment relation is not inherited).

Things that you would inherit would be like the version of a dependency to use, or a configuration for a plugin, or the location of the repositories from where to get dependencies or to which result artefacts will be pushed. Indeed, all Maven modules automatically inherit from a built-in POM that supplies much of this information. You can find out what the overall effect of all this inheritance is for a particular module by getting its effective POM:

mvn help:effective-pom

(If you've got Maven integrated into your IDE, you'll have to look around for how to find this information. For example, with Eclipse, the effective POM is on a separate tab in the Maven POM editor view.)

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
0

What is the POM?

POM stands for "Project Object Model". It is an XML representation of a Maven project held in a file named pom.xml.

One powerful aspect of Maven is in its handling of project relationships; that includes dependencies (and transitive dependencies), inheritance, and aggregation (multi-module projects).

Maven has many OO concepts including:

  • aggregation - multi-module projects

  • inheritance - parent projects

In Maven project is an object, module is an object and projects can depends on others projects.

Community
  • 1
  • 1
MariuszS
  • 30,646
  • 12
  • 114
  • 155