Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell eclipse to ignore: "No persistence.xml file found in project"

For my projects Necessity i regroup all the persistence.xml entries in one core project which i bind as maven dependency wherever i need.

The problem is that the eclipse IDE is always complaining about

No persistence.xml  file found in project

Is there away to keep eclipse quiet about this? Thanks

like image 476
Festus Tamakloe Avatar asked Nov 29 '13 13:11

Festus Tamakloe


People also ask

Is managed but is not listed in the persistence XML file eclipse?

If you are using Eclipse:(1) Select: (Your Project) -> Properties -> JPA; (2) Look for "Persistent class management" and select the option "Discover annotated classes automatically"; (3) Press "Apply".

Where should persistence xml be located?

If you package the persistence unit as a set of classes in a WAR file, persistence. xml should be located in the WAR file's WEB-INF/classes/META-INF directory.

What is the purpose of the persistence XML file?

The persistence. xml configuration file is used to configure a given JPA Persistence Unit. The Persistence Unit defines all the metadata required to bootstrap an EntityManagerFactory , like entity mappings, data source, and transaction settings, as well as JPA provider configuration properties.


2 Answers

Thanks to sionnach733 who put me on the right way

enter image description here

like image 95
Festus Tamakloe Avatar answered Oct 05 '22 05:10

Festus Tamakloe


Window->Preferences->Java Persistence-> JPA-> Errors/warnings-> Project

Then change it from error to whatever you like(warning/info/ignore). You could also choose configure project specific settings if you don't want it to affect other projects

like image 24
Sionnach733 Avatar answered Oct 05 '22 07:10

Sionnach733