When to use dependencymanagement and dependencies in the maven project. We are decomposing the existing project into 6 independent modules. Those are
Project-core
project-DAO
project-messages
project-services
project-testing
project-web
we are planning to have parent to all the above projects and place the common dependencies there. But we are not clear about where to use the <dependencyManagement> and <dependencies>. Please provide the valuable suggestions.
Thanks,
Anil Kumar C
Based on your ideas i would suggest the following folder structure:
which result into having a parent (ProjectParent) which should contain the dependencyManagement section to define the dependencies with their appropriate versions like this:
In every module you need the parent to reference to the parent:
com.company.project
project-parent
1.0.0-SNAPSHOT
and in a module you just define
to use the dependency from the parent.
This will simplify the update of dependencies, cause the version are located into a single point which means in the parent root and not distributed into different modules.