Search code examples
javajpaeclipselink

Can I have a JPA Project Jar inside a WebAPP lib directory?


I want to create a JPA project common for two websites projects that I will create. If I use the jar exported from the jpa project as a library in the web1 and web2. Can I still have the JPA functionality?

Eclipse Workspace
|_JPA Project
|_Web1 Project
|__WEB-INF
|___lib
|____JPA.jar
|_Web2 Project
|__WEB-INF
|___lib
|____JPA.jar

Solution

  • as long as you have the persistence.xml file located on the META-INF folder on your JPA project it should work ok