EclipseLink JPA - location of persistence.xml
JPA persistence XML file location
Traditionally, the persistence.xml is located in a META-INF
folder that needs to reside in the root of the Java classpath. If you’re using Maven, you can store it in the resources
folder, like this:
src/main/resources/META-INF/persistence.xml
persistence.xml
should be put inside an directory called META-INF
under the root of the classpath .
Right click your project in eclipse ==> Properties ==> Java Build Path . Suppose you configure one of the build paths to be /src/main/resources
, then you should put the persistence.xml
at /src/main/resources/META-INF/persistence.xml