google-app-engine – 迁移到Cloud Endpoints Frameworks 2.0 for App Engine

我目前正在尝试从Cloud Endpoints 1.0迁移到Cloud Endpoints Frameworks 2.0.

我按照这里列出的步骤:
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'

有:

compile 'com.google.endpoints:endpoints-framework:2.0.0-beta.5'
compile 'javax.inject:javax.inject:1'

在web.xml中,我用EndpointsServlet替换了SystemServiceServlet,用/ _ah / api / *替换了/ _ah / spi / *.

但是在编译时,我收到以下错误:

06002

我错过了什么吗?

根据@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
    }
}

更新:

现在有一份指南详细说明了过渡进程: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插件正在更新中,因此您现在需要注释掉/删除端点片段,以便在构建时不生成客户端库.然后,如果您需要生成客户端库,请立即执行
manually.

点赞