I created a modular web project using Apache Maven with the following structure:
proj-build
|--- proj-utils
|--- proj-persistence
|--- proj-services
|--- proj-web
'--- proj-ear
Description
proj-build : This groups the modules only to perform the chain build on the modules, ie each project has its own configuration when the build is performed, without any relationship with this project parent (proj-build).
proj-utils : This module brings together utilitarian classes like: Exceptions Classes, Hibernate SessionFactory Classes, etc.
proj-persistence : This module brings together entity classes, DAO classes, DAO interfaces. It has dependencies like JPA, Hibernate, etc.
proj-services : This module brings together classes that implement business logic. It has dependency on the proj-persistence module.
proj-web : This module brings together the Controllers, HTML pages, CSS, Javascript and any other resources you require on the pages. It has dependency with the module proj-services, Spring MVC, Spring Security, JSTL, Java Servlet, etc.
proj-ear : This module has dependency on all other modules except proj-build. This module packages the other modules in an EAR package.
My question is: How do I apply the Spring Framework DI / IoC as a dependency in this modular design? Do I apply dependency on all modules or on a specific module?