I'm trying to configure and Maven multi-module project with Spring / JPA. Here's the general layout. I have a root module with 5 children modules.
backoffice (root maven module) | -(maven module)-----core (this is where persistence.xml and entityManager stuff resides). | -(maven module)-----employee (employee related entities, controllers, etc.) | -(maven module)-----vendor (vendor related entities, controllers, etc.) | -(maven module)-----customer (customer related entities, controllers, etc.) | -(maven module)-----web (contains all the web stuff).
I have all the jpa stuff in core/src/main/resources/META-INF (persistence.xml, spring-context w/ EntityManagerFactory, dataSource, etc.). The idea is I want to share the persistence stuff across all sub-modules (employee, vendor and customer).
The problem is that when the web app starts up, it can't find the EntityMangerFactory. If I setup the JPA stuff in each sub module (employee, vendor and customer), then it works.
How do I setup all my persistence related stuff in core and then share it across the other modules?
Thanks in advance.