使用IntelliJ时,为什么我的Google App Engine类没有增强?

时间:2017-10-26 13:32:18

标签: java google-app-engine intellij-idea gradle datanucleus

我的项目是用gradle构建的。如果我从命令行运行测试,一切正常:

./gradlew test --tests '*.UserTest'

但是当我尝试从Intelli中运行测试时,它无法运行,因为我的类不是增强

javax.jdo.JDOUserException: Persistent class "Class com.example.Foo does not seem to have been enhanced. You may want to rerun the enhancer and check for errors in the output." has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class.

运行任务appengineEnhance没有任何区别。

1 个答案:

答案 0 :(得分:5)

事实证明,默认情况下,IntelliJ将使用平台运行器来运行测试。您需要选择gradle runner。

preferences > build[...] > build tools > gradle > runner并选择委派IDE构建/运行操作以进行gradle

enter image description here