On 12 February 2014 20:12, Adrien Rivard <[email protected]> wrote:
> Hi,
>
> DependencyManagement is declaring dependencies(mostly for versions) and
> dependencies is using them,
> So in general you should have only dependencyManagement in the parent poms
> and only dependencies in the childs.
>
> Now there are exceptions, for example junit is generally used in all child
> projects , so you can add it in dependencies of the parent pom and it will
> be avaible in all childs.

Adding dependencies into the pom with modules is a bad idea,
There will always be an exception that breaks that rule.
Then you will be asking how do I remove a dependency from a child pom
- you can't, dont define it in the first place.

Typical exceptions would be poms whose sole purpose is to build an
assembly (zip file) for package management, or Ear poms, etc.

A best practice is to never have any dependencies in a pom that has modules.
If you want to share common dependencies between projects, then you
can look at using the inherit type relationship but that pom would be
a standalone pom with no module declarations.
Your top level project is an Aggregation pom to make running Maven easier.
See https://maven.apache.org/pom.html#Aggregation

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to