From 3df2486163bbe88ab1c7c8643c1efd15e1fd08cb Mon Sep 17 00:00:00 2001 From: Tang Cheng Date: Tue, 2 Jul 2019 14:22:34 +0800 Subject: [PATCH] =?utf8?q?=E2=80=99=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?utf8?q?=E5=8F=82=E6=95=B0=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- build.gradle | 35 +++++++++++++++++-------- gradle.properties | 2 +- src/main/resources/META-INF/MANIFEST.MF | 2 ++ 3 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/META-INF/MANIFEST.MF diff --git a/build.gradle b/build.gradle index 1718a713..00c9da33 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,4 @@ plugins { - id 'war' id 'org.springframework.boot' id 'org.jetbrains.kotlin.jvm' id 'org.jetbrains.kotlin.plugin.jpa' @@ -7,6 +6,7 @@ plugins { id "com.palantir.git-version" version "0.12.0-rc2" } +apply plugin: 'java' apply plugin: 'io.spring.dependency-management' payapiVersion = gitVersion() @@ -14,25 +14,36 @@ payapiVersion = gitVersion() group = 'com.supwisdom' version = payapiVersion sourceCompatibility = jdkVersion +def startClass = 'com.supwisdom.dlpay.PayApiApplicationKt' println("Build version: $version") repositories { mavenCentral() } -war { - enabled = true - manifest { - attributes('Payapi-Version': rootProject.version) - writeTo(project.buildDir.toString() + "/classes/MATE-INF.MF") - } +springBoot { + mainClassName = startClass } -bootWar { - excludeDevtools = false - mainClassName = 'com.supwisdom.dlpay.PayApiApplication' + +bootJar { + launchScript() + mainClassName = startClass } +//war { +// enabled = true +// manifest { +//// attributes('Payapi-Version': rootProject.version) +//// attributes('Main-Class': 'org.springframework.boot.loader.WarLauncher') +//// attributes 'Start-Class': startClass +// } +//} + +//bootWar { +// launchScript() +//} + dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' @@ -54,6 +65,8 @@ dependencies { implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' + runtime("org.springframework.boot:spring-boot-devtools") + implementation 'org.postgresql:postgresql:42.2.5' implementation 'com.fasterxml.jackson.module:jackson-module-kotlin' implementation 'com.jcabi:jcabi-manifests:1.1' @@ -72,7 +85,7 @@ dependencies { annotationProcessor 'org.projectlombok:lombok:1.18.8' compileOnly 'org.projectlombok:lombok:1.18.8' - providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' +// providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'io.rest-assured:rest-assured:3.3.0' testImplementation 'io.rest-assured:spring-mock-mvc:3.3.0' diff --git a/gradle.properties b/gradle.properties index f72e65cb..557297f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -springbootVersion = 2.1.3.RELEASE +springbootVersion = 2.1.6.RELEASE kotlinVersion = 1.3.31 payapiVersion = 1.0 jdkVersion = 1.8 \ No newline at end of file diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 00000000..8b05d485 --- /dev/null +++ b/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Main-Class: org.springframework.boot.loader.WarLauncher +Start-Class: com.supwisdom.dlpay.PayApiApplication -- 2.17.1