GCP App Engine,Spring Boot和Pub Sub结果为403

loading...


0

我可以将Spring Boot(2.1.1.RELEASE)部署到App Engine,并且可以访问/并获得一个hello world . 出现的问题是当我将Googles Pub Sub库包含到Gradle构建文件中时 . 当我在403中部署击中/结束时,所以我不太确定会发生什么 . 幕后可能存在某种依赖问题?我的build.gradle就是这个

buildscript {

    ext.kotlin_version = '1.3.10'
    ext.springBootVersion = '2.1.1.RELEASE'
    ext.appEngineVersion = '2.0.0-rc3'

    repositories {
        jcenter()
        mavenCentral()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
        classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.0.0-rc3'
    }
}

repositories {
    maven {
        url 'https://maven-central.storage.googleapis.com'
    }

    jcenter()
    mavenCentral()
}

apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'war'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "com.google.cloud.tools.appengine"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
    jcenter()
}

dependencies {
    implementation 'org.jetbrains.kotlin:kotlin-stdlib'

    implementation 'org.springframework.boot:spring-boot-starter-web'

    implementation 'com.google.appengine:appengine-api-1.0-sdk:+'
    implementation "org.springframework.cloud:spring-cloud-gcp-starter-pubsub:+"
    implementation "org.springframework.integration:spring-integration-core"
    
    implementation 'javax.servlet:javax.servlet-api:3.1.0'

    testImplementation 'com.google.appengine:appengine-testing:+'
    testImplementation 'com.google.appengine:appengine-api-stubs:+'
    testImplementation 'com.google.appengine:appengine-tools-sdk:+'
}

configurations.all {
    exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
    exclude group: 'org.slf4j', module: 'jul-to-slf4j'
}

appengine {
    deploy {
        stopPreviousVersion = true
        promote = true
        projectId = "GCLOUD_CONFIG"
        version = "GCLOUD_CONFIG"
    }
}

compileKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}
compileTestKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

即使我直接添加Google的库而不是使用Spring Boot的包装器,这个问题仍然存在 . 我可以提供App Engine实例的启动日志,但我目前看不到任何明显的内容 .

错误的是使用org.springframework.boot:spring-boot-starter-web而不仅仅是gcp-starter?你能在 Spring 季靴子中只使用一个起动器吗?

loading...

0回答

No Data

评论

暂时没有评论!