Java – persistence. 0 was not found during Maven testing xml

I'm trying to load the test database in the test database for the Maven build process of integration testing persistence. The XML is copied correctly to target / test classes / meta inf /, but I get this exception when the test runs

It looks like it didn't find or load persistence xml.

Solution

Just solve the same problem as the JPA project based on Maven / eclipse

I have my meta - inf directory under Src / main / Java in order not to copy it to the target directory before the test phase

Moving this directory to Src / main / resources solves the problem and ensures that meta-inf / persistence. Inf exists in the target / class when running the test XML file

I think JPA will my meta inf / persistence The XML file is placed in Src / main / Java, which proves to be the root of my problem

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>