我目前正在尝试从 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 中,我将 SystemServiceServlet 替换为 EndpointsServlet ,将 /_ah/spi/* 替换为 /_ah/api/*

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



我错过了什么吗?

按照@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 插件正在更新中,现在您需要注释掉/删除 endpoints 片段,以便在构建时不会生成客户端库。然后,如果您需要生成客户端库,请立即执行 manually

关于google-app-engine - 迁移到适用于 App Engine 的 Cloud Endpoints Frameworks 2.0,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39342980/

10-10 20:08