【发布时间】:2019-02-02 04:14:27
【问题描述】:
我已经搜索了 tutorial 以使用 Gradle 部署 Spring boot 应用程序。我找不到任何资源来解释这样做的过程。
谁能指导我这个过程?
当它在我的机器上本地运行时,我的项目就像一个魅力。但我想部署在 Google 应用引擎的灵活 Java 环境上。
谢谢,提前。
我的 build.gradle 看起来像这样
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
jwtVersion = '3.4.0'
appEngineVersion = '1.9.56'
appEngineGradleToolsVersion = '1.3.4'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile("org.springframework.boot:spring-boot-starter-security")
// JPA Data (We are going to use Repositories, Entities, Hibernate, etc...)
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
// Use MySQL Connector-J
compile 'mysql:mysql-connector-java'
implementation "com.auth0:java-jwt:${jwtVersion}"
runtime('org.springframework.boot:spring-boot-devtools')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
【问题讨论】:
-
你看过这个:cloud.google.com/appengine/docs/flexible/java/using-gradle。它解释了如何在 App Engine Flex 上使用 gradle。
标签: java spring-boot google-app-engine gradle gradle-plugin