我正在尝试使用gradle部署我的第一个应用引擎spring引导项目,当我运行" gradle appengineDeploy"时,我遇到了以下错误:
ERROR: (gcloud.app.deploy) Error Response: [403] Operation not allowed
Details: [
[
{
"@type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "The \"appengine.applications.get\" permission is required.",
"resourceType": "gae.api"
}
]
]
这是我的build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.2.RELEASE")
classpath("com.google.cloud.tools:appengine-gradle-plugin:+")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'com.google.cloud.tools.appengine'
jar {
baseName = 'gs-spring-boot'
version = '0.1.0'
}
repositories {
mavenCentral()
maven {
url 'https://maven-central.storage.googleapis.com'
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
// tag::actuator[]
compile("org.springframework.boot:spring-boot-starter-actuator")
// end::actuator[]
// tag::tests[]
testCompile("org.springframework.boot:spring-boot-starter-test")
// end::tests[]
//compile("com.google.cloud.tools:appengine-maven-plugin:1.0.0")
//appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.50'
compile('com.google.appengine:appengine:+')
}
appengine {
deploy { // deploy configuration
stopPreviousVersion = true // default - stop the current version
promote = true // default - & make this the current version
}
}
请告诉我如何继续。
答案 0 :(得分:12)
我在更新google cloud sdk后得到了这个。我只是再次运行gcloud init
并输入相同的选项。
答案 1 :(得分:1)
我重新创建了应用引擎实例,问题已修复
答案 2 :(得分:0)
有点傻,但是我通过错误输入GCP项目名称来解决这个错误:
$ gcloud app deploy app.yaml --project=wrong-project-name
答案 3 :(得分:0)
我通过在其API控制台中启用“ Google App Engine”云API来解决此问题。