在Cloud Endpoints Frameworks 2.0 for App Engine中增强端点 [英] Enhancing endpoints in Cloud Endpoints Frameworks 2.0 for App Engine

查看:184
本文介绍了在Cloud Endpoints Frameworks 2.0 for App Engine中增强端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了来自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.

我已按照此处列出的步骤进行操作: https://cloud.google.com/appengine/docs/java/ endpoints / migrating?authuser = 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:


Er ror:(60,0)无法在com.google.cloud.tools.gradle.appengine.core.AppEngineExtension类型的对象上找到参数[build_2dn4fni12bkrsqgsi25gsx3hh $ _run_closure2 $ _closure7 @ 6b02ee9e]的方法增强器()。

Error:(60, 0) Could not find method enhancer() for arguments [build_2dn4fni12bkrsqgsi25gsx3hh$_run_closure2$_closure7@6b02ee9e] on object of type com.google.cloud.tools.gradle.appengine.core.AppEngineExtension.

如果我删除 enhancer 部分,我会收到以下错误:

And if I remove the enhancer part, I get the following error:


org.datanucleus.metadata.MetaDataManager initialiseFileMetaDataForUse:找到类[...]的元数据,但这个类没有增强!!请在运行DataNucleus之前增强类。

org.datanucleus.metadata.MetaDataManager initialiseFileMetaDataForUse: Found Meta-Data for class [...] but this class is not enhanced!! Please enhance the class before running DataNucleus.

那么,新框架中的等效增强是什么?
(我正在使用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.

这里有一个解决方法 https://stackoverflow.com/a / 29279504/3190492

增强器{...} 部分中也没有任何价值。不需要 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中增强端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆