我想在google应用引擎上部署我的spring应用,但我收到了这个错误消息:
Execution failed for task ':appengineDeploy'.
> Deployment projectId must be defined or configured to read from system state
1. Set appengine.deploy.projectId = 'my-project-id'
2. Set appengine.deploy.projectId = 'GCLOUD_CONFIG' to use project from gcloud config.
3. Using appengine.deploy.projectId = 'APPENGINE_CONFIG' has been deprecated.我的笔记本电脑上已经安装了谷歌云sdk和应用程序引擎工具。
我在网上搜索,我发现我必须把项目ID放在gradle文件中:
appengine {
deploy {
projectId = "my-project-id"
}
}但问题是gradle不能恢复所有这些属性。
我的gradle文件是否有问题,可能导致此问题?
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
classpath("com.google.cloud.tools:appengine-gradle-plugin:2.1.0")
}
}
plugins {
id("org.springframework.boot") version "2.2.0.M4"
id("io.spring.dependency-management") version "1.0.7.RELEASE"
kotlin("jvm") version "1.3.31"
kotlin("plugin.spring") version "1.3.31"
}
apply(plugin = "com.google.cloud.tools.appengine")
group = "com.demo.app"
version = "1.0"
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
maven { url = uri("https://repo.spring.io/snapshot") }
maven { url = uri("https://repo.spring.io/milestone") }
}
extra["springCloudVersion"] = "Hoxton.M1"
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-server")
implementation("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
exclude(group = "junit", module = "junit")
}
}
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-
dependencies:${property("springCloudVersion")}")
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}发布于 2019-08-15 05:21:13
在你的SDK中尝试setting your project,然后使用the below code
appengine {
deploy {
projectId = "GCLOUD_CONFIG"
}
}https://stackoverflow.com/questions/57501388
复制相似问题