问题描述
我收到了来自GCP的电子邮件,要求将我的项目从Cloud Endpoints 1.0迁移到Cloud Endpoints Frameworks 2.0。
I have received an email from GCP to migrate my project from Cloud Endpoints 1.0 to Cloud Endpoints Frameworks 2.0.
我已按照此处列出的步骤进行操作:
I've followed the steps outlined here: https://cloud.google.com/appengine/docs/java/endpoints/migrating?authuser=0
在我之前的build.gradle中,我有了这个指令来增强我的端点并且工作正常:
In my previous build.gradle I had this directive to enhance my endpoints and it worked fine:
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
enhancer {
version = "v2"
api="jdo" // or "jpa"
enhanceOnBuild = true
}
}
但是,之后迁移和编译时,我收到以下错误:
However, after migration and on compile, I get the following error:
如果我删除 enhancer
部分,我会收到以下错误:
And if I remove the enhancer
part, I get the following error:
那么,新框架中的等效增强是什么?
(我正在使用Android Studio 2.3.3)
So, what is the equivalent enhancing in the new framework?(I'm using Android Studio 2.3.3)
推荐答案
问题是新的gradle插件没有' t具有增强jpa / jdo类所需的任务 appengineEnhance
。
The problem is that the new gradle plugin doesn't have the task appengineEnhance
which is required to enhance your classes for jpa/jdo.
这里有一个解决方法
在增强器{...}
部分中也没有任何价值。不需要 appengine
块,并且该配置应该在上面链接的脚本中完成。
It's also worth nothing that the enhancer {...}
section in the appengine
block won't be required and that configuration should be done in the script in the link above.
这篇关于在Cloud Endpoints Frameworks 2.0 for App Engine中增强端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!