Search code examples
javaeclipseeclipse-wtp

How to deploy persistence.xml in a web project?


I have a web project created with 'Dynamic Web Project'. I don't use Ant neither Maven in this project and I want to deploy the persistence.xml file to the directory WEB-INF/classes/META-INF (that is the standard place where persistence.xml should reside according to the Java EE 7 standard in a war archive), but I don't see any way to configure this in Eclipse. Is there a way to achieve this?

Thank you.

Marcos


Solution

  • Simplify you have to add additional path (WEB-INF/classes/META-INF - I suppose that WEB-INF is already there). After that you have to create persistence.xml and add this folder to build path (Im not pretty sure if this is a necessary condition).