icordoba
icordoba

Reputation: 1899

Where to put persistence.xml in a Eclipse EJB Gradle project?

a) If I put persistence.xhtml in src/main/java/META-INF/ Gradle won't include it in generated jar file, as it is not a java file.

b) If I put it in src/main/resources/META-INF/ Gradle will include it in generated jar file but Eclipse will complain of "No persistence.xml file found in project" even if I include src/main/resources in source build path.

How can I solve this?

Upvotes: 0

Views: 711

Answers (1)

Klaus Groenbaek
Klaus Groenbaek

Reputation: 5045

resources/META-IN/ is the correct location. I don't use Eclipse, so I can't help you, but I'm sure it's some kind of configuration issue.

These days I use Spring to bootstrap my JPA, and then I don't even need a persistence.xml file, which is good since I like code and hate configuration files.

Upvotes: 1

Related Questions