maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From codingplayer <>
Subject where to put common dependecies in multi-module project
Date Mon, 24 Oct 2011 07:58:31 GMT

i'm wondering where to put my common dependenies in my multimodule project.

Let's say, we have a project called sandbox, with three submodules.
- sandbox-core
- sandbox-service
- sandbox-web

Existing dependencies:
- sandbox-service has a dependency to sandbox-core
- sandbox-web has a dependency to sandbox-service

So practically, all dependencies of sandbox-core, will be transitive
dependencies for the other modules.

Let's say i want to use slf4j as logging framework, which should probable be
used in all modules and all of them should also use the same version.

I see different approaches on this:
- i could add the dependencies to the parent pom (sandbox)
- i could also only define a property for the version, e.g.
${slf4j.dependency.version} in the parent pom (sandbox) and actually add the
dependency on core level (sandbox-core)
- i could also simply add the dependency (plus version) to the core level

I already had some problems, when not building the whole project (on
sandbox) level, that not all dependencies have been resolved in my leave
module (sandbox-web).

So i assume when putting the dependencies in the sandbox-core, one will
always have to build the whole project in order to have a working
sandbox-web module, while when putting them into the parent directly, the
dependencies would be retrieved by maven correctly anyway, since the
parent-poms are always taken intoconsideration, even when only the
sandbox-web is built.

So, what would be the best-practice on that?
What exact differences would be there between direct dependencies and
transitive dependencies?
Where should i put those common dependencies?


View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message