I have created a Google app engine project using an maven archetype project with the Datanucleus JPA provider, essentially following the Google app engine documentation.
Everything works fine when running the maven goal "test".
Now I had to integrate the project into Android studio and wanted to migrate the build script to gradle. I copied all dependencies from the pom.xml
to the build.gradle
and the project builds fine. However, all tests that access the Google datastore fail.
During test output I get the following message:
Warning:No META-INF/persistence.xml files were found in the CLASSPATH of the current thread!
I checked the build
folder which is created during the build and no folder contains the persistence.xml
from src/main/webapp/WEB-INF/classes/META-INF
Using maven, however, it is correctly put in the target/myapp-1.0-SNAPSHOT/WEB-INF/classes/META-INF
folder.
I have tried copying the persistence.xml
using a gradle copy task into various locations, such as build/classes/META-INF
build/classes/webapp/WEB-INF/classes/META-INF
and so on, but nothing worked.