Reputation: 548
Sorry to ask this again. Please let me know if I got this right?
We have a parent pom and multiple modules. Now if all children projects want to inherit the same jar files (for example spring), I can put them in in the parent project pom and need not include them in the child pom.
And if I put in dependencies under in the parent pom, they are not included in all the children projects, but I can include the ones I need (for example test) by adding them in without the need to specify a version.
Is this right or am I totally off? Hope I'm clear on my q.
All I need is a giant parent pom with all dependencies. The children should get some of the common dependencies automatically and the specific ones that each child needs.
Thanks
Harish
Upvotes: 7
Views: 18985
Reputation: 29912
In dependencyManagement you declare dependency versions, exclusions and other things that let you manage them in place (e.g. a parent pom) for multiple projects.
In dependencies you then declare the actual usage/need of a dependency and if the dependency is managed in a parent pom you can do so without using a version and it will be inherited and therefore be consistant across your usages downstream of the the parent pom.
Same logic applies for pluginManagement and plugins by the way including plugin configuration.
Upvotes: 17