簡體   English   中英

遷移到雲端點適用於App Engine的Frameworks 2.0

[英]Migrating to 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/* /_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
    }
}

更新:

現在有一個指南詳細介紹了轉換過程: 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片段,以便在構建時不生成客戶端庫。 然后,如果您需要生成客戶端庫,請立即手動執行。

嗨,不知道你是否已經修好了,但這解決了我的問題

編譯'com.google.endpoints:endpoints-framework:2.0.0-beta.9'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM