我目前正在尝试从Cloud Endpoints 1.0
迁移到Cloud Endpoints Frameworks 2.0
。迁移到云端点App Engine的框架2.0
我已经按照这里列出的步骤:我把它换成
compile 'com.google.endpoints:endpoints-framework:2.0.0-beta.5'
compile 'javax.inject:javax.inject:1'
而在web.xml
:我把它换成 https://cloud.google.com/appengine/docs/java/endpoints/migrating?authuser=0
在我build.gradle
:
compile 'com.google.appengine:appengine-endpoints:1.9.42'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.42'
与SystemServiceServlet
与EndpointsServlet
和/_ah/spi/*
与/_ah/api/*
。
但是在编译,我得到以下错误:
Error:Execution failed for task ':myapp_backend:appengineEndpointsGetClientLibs'. > There was an error running endpoints command get-client-lib: web.xml must have 1 (found:0) SystemServiceServlet servlet
我这么想吗?
编辑,由@saiyr的要求,这里是我的build.gradle
文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
// AppEngine
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'
compile 'javax.servlet:servlet-api:2.5'
// Cloud Endpoints
compile 'com.google.appengine:appengine-endpoints:1.9.42'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.42'
// Cloud Endpoints Frameworks
// compile 'com.google.endpoints:endpoints-framework:2.0.0-beta.7'
// compile 'javax.inject:javax.inject:1'
// Project
compile files('src/main/webapp/WEB-INF/lib/gson-2.3.1.jar')
compile 'com.googlecode.objectify:objectify:5.1.9'
compile 'com.ganyo:gcm-server:1.0.2'
compile 'com.google.appengine.tools:appengine-gcs-client:0.5'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}
UPDATE:
现在有一个指南,详细说明在此转型过程:https://github.com/GoogleCloudPlatform/endpoints-framework-gradle-plugin/blob/master/ANDROID_README.md
这里:https://cloud.google.com/endpoints/docs/frameworks/legacy/v1/java/migrating-android
不,你不会错过任何东西。遗憾的是,Gradle App Engine插件尚未更新为使用测试版库。你使用什么构建任务? – saiyr
@saiyr该死的,我想要做的就是使用现在提到的[Cloud Endpoints登陆页面](https://cloud.google.com/endpoints/)上的Firebase Auth,但它似乎在[最近的Google云平台博客文章](https://cloudplatform.googleblog.com/2016/09/manage-your-APIs-with-Google-Cloud-Endpoints.html)它只适用于新的测试版,这就是为什么我试图迁移。我使用Gradle的'appengineUpdate'任务来构建和部署我的后端。我的假设是否正确,我必须从'Cloud Endpoints 1.0'迁移到'Cloud Endpoints Frameworks 2.0'以使用'Firebase Auth'? – gbhall
是的,你需要使用2.0。令我惊讶的是,'gradle appengineUpdate'会触发'appengineEndpointsGetClientLibs'任务。这是一个Android Studio文件吗?你可以发布你的'build.gradle'吗? – saiyr