使用Gradle部署GAE时奇怪的构建失败 [英] Strange build failure when deploying GAE using gradle

查看:71
本文介绍了使用Gradle部署GAE时奇怪的构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到今天,一切正常。据我所知,并没有改变任何东西,现在我得到了:

Everything used to work fine until today. Didn't change anything as far as I know and now I get this:

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的版本,但我之前从未声明过,因此我认为这是由于Google方面的某些更新。我想念什么?

I just updated gradle from version 4.5.1 to 4.8.1 but the same issue remains. I understand it complains about version of the appengine but I never had to state that before so I think it's due to some update on Google's side. What am I missing?

推荐答案

您正在使用 app-gradle-plugin 版本<我从中可以看到一个href = https://github.com/GoogleCloudPlatform/app-gradle-plugin/releases/tag/v2.0.0-rc1 rel = noreferrer> 2.0.0-rc1 您的控制台输出(两天前发布)。

You are now using the app-gradle-plugin version 2.0.0-rc1 as I can see from your console output, which was released 2 days ago. It has some changes, which the developers of the plugin documented.

如您在更改此候选谷歌的日志,并在更改中提及:

As you can see in the Change Log of this release candidate from google, it mentions in the changes:


项目和版本不再从全局gcloud状态中提取。必须使用deploy.project属性在build.gradle中配置项目,用户可以为项目使用特殊关键字,以指定他们希望从appengine-web.xml(project = APPENGINE_CONFIG)或gcloud全局状态( project = GCLOUD_CONFIG)。版本也以相同的方式配置。

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中指定以下内容:

So you just have to specify in your gradle.build the following:

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

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

Update in 2.0.0-rc3 (Thanks to @wildcat12 for pointing it out) in the latest version 2.0.0-rc3, the project configuration property has changed.


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

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

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

Therefore, now your gradle.build configuration would look like that:

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

这篇关于使用Gradle部署GAE时奇怪的构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆