gpt4 book ai didi

google-app-engine - 使用 gradle 部署 GAE 时出现奇怪的构建失败

转载 作者:太空宇宙 更新时间:2023-11-03 15:23:59 25 4
gpt4 key购买 nike

直到今天,一切都运行良好。据我所知没有改变任何东西,现在我明白了:

C:\mypath>gradle appengineDeploy

> Configure project :
WARNING: You are a using release candidate 2.0.0-rc1. Behavior of this plugin has changed since 1.3.5. Please see release notes at: https://github.com/GoogleCloudPlatform/app-gradle-plugin.
Missing a feature? Can't get it to work?, please file a bug at: https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues.

> Task :appengineDeploy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':appengineDeploy'.
> Deployment version must be defined or configured to read from system state
1. Set appengine.deploy.version = 'my-version'
2. Set appengine.deploy.version = 'GCLOUD_CONFIG' to have gcloud generate a version for you.
3. Using APPENGINE_CONFIG is not allowed for flexible environment projects

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 6s
8 actionable tasks: 6 executed, 2 up-to-date

我刚刚将 gradle 从版本 4.5.1 更新到 4.8.1,但同样的问题仍然存在。我知道它提示 appengine 的版本,但我之前从未声明过,所以我认为这是由于谷歌方面的一些更新。我错过了什么?

最佳答案

您现在使用的是 app-gradle-plugin 版本 2.0.0-rc1正如我从 2 天前发布的控制台输出中看到的那样。它有一些变化,插件的开发人员记录了这些变化。

正如您在 Change Log 中看到的那样来自谷歌的这个候选版本,它在更改中提到:

project and version are no longer pulled from the global gcloud state by default. project must be configured in build.gradle using the deploy.project property, users may use special keywords for project to specify that they would like to read it from appengine-web.xml (project = "APPENGINE_CONFIG") or from gcloud global state (project = "GCLOUD_CONFIG"). version is also configured the same way.

因此您只需在 gradle.build 中指定以下内容:

appengine {
deploy {
version = "GCLOUD_CONFIG"
project = "GCLOUD_CONFIG"
}
}

在 2.0.0-rc3 中更新 (感谢@wildcat12 指出)在最新版本2.0.0-rc3 , project 配置属性已更改。

Changed appengine.deploy.project -> appengine.deploy.projectId

因此,现在您的 gradle.build 配置将如下所示:

appengine {
deploy {
version = "GCLOUD_CONFIG"
projectId = "GCLOUD_CONFIG"
}
}

关于google-app-engine - 使用 gradle 部署 GAE 时出现奇怪的构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51087334/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com