blob: 2f1eed1d2c6fcf879d59dc93044d49ec82c54fcc [file] [log] [blame]
Tang Chenge7d3a0e2019-07-08 16:27:33 +08001plugins {
Tang Cheng91ca2772019-12-16 08:59:52 +08002 id "java"
3 id "org.springframework.boot"
4 id "org.jetbrains.kotlin.jvm"
5 id "org.jetbrains.kotlin.plugin.jpa"
6 id "org.jetbrains.kotlin.plugin.spring"
7 id "com.palantir.docker"
Tang Chenge7d3a0e2019-07-08 16:27:33 +08008}
9
Tang Cheng1d565842019-12-18 20:33:41 +080010apply plugin: 'io.spring.dependency-management'
11apply plugin: 'kotlin'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080012
Tang Cheng91ca2772019-12-16 08:59:52 +080013def payapiStartClass = "com.supwisdom.dlpay.PayApiApplicationKt"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080014
Tang Chengf36d7252019-12-17 14:14:50 +080015println("Build version: $buildVersion")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080016
17bootJar {
Tang Cheng1d565842019-12-18 20:33:41 +080018 enabled = true
Tang Cheng8beabcd2019-07-12 11:48:01 +080019 mainClassName = payapiStartClass
Tang Chenge7d3a0e2019-07-08 16:27:33 +080020 manifest {
Tang Chengf36d7252019-12-17 14:14:50 +080021 attributes("Payapi-Version": buildVersion,
Tang Cheng1d565842019-12-18 20:33:41 +080022 "Payapi-Buildtime": buildTime)
Tang Chenge7d3a0e2019-07-08 16:27:33 +080023 }
24}
25
Tang Cheng91ca2772019-12-16 08:59:52 +080026compileKotlin {
27 kotlinOptions {
28 freeCompilerArgs = ["-Xjsr305=strict"]
29 jvmTarget = jdkVersion
30 }
31}
32
33compileTestKotlin {
34 kotlinOptions {
35 freeCompilerArgs = ["-Xjsr305=strict"]
36 jvmTarget = jdkVersion
37 }
Tang Cheng468da542019-09-12 11:29:48 +080038}
39
Tang Chenge7d3a0e2019-07-08 16:27:33 +080040docker {
Tang Cheng1b745242019-07-25 09:28:16 +080041 def imageVersion
Xia Kaixiang910ebfa2019-10-12 17:48:43 +080042 if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) {
Tang Cheng91ca2772019-12-16 08:59:52 +080043 imageVersion = "dev"
Tang Cheng1b745242019-07-25 09:28:16 +080044 } else {
45 imageVersion = details.lastTag
46 }
Tang Cheng1d565842019-12-18 20:33:41 +080047 println("Docker image tag : ${imageVersion}")
48 name "${dockerRegistry}/payapi:${imageVersion}"
49 println(jar.archiveFile.get())
50 files jar.archiveFile.get()
Tang Chenge7d3a0e2019-07-08 16:27:33 +080051}
52
53docker.dependsOn(jar)
54
55dependencies {
Tang Cheng91ca2772019-12-16 08:59:52 +080056 implementation project(":payapi-common")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080057
Tang Cheng91ca2772019-12-16 08:59:52 +080058 implementation "org.springframework.boot:spring-boot-starter-web"
59 implementation "org.springframework.boot:spring-boot-starter-security"
60 implementation "org.springframework.boot:spring-boot-starter-cache"
61 implementation "org.springframework.boot:spring-boot-autoconfigure"
62 implementation "org.springframework.security:spring-security-oauth2-jose"
63 implementation "org.springframework.security:spring-security-oauth2-client"
64 implementation "org.springframework.security:spring-security-oauth2-jose"
Tang Cheng07b36f12019-12-16 11:41:58 +080065 implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure"
Tang Cheng91ca2772019-12-16 08:59:52 +080066 implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
67 implementation "org.springframework.session:spring-session-data-redis"
68 implementation "org.springframework.boot:spring-boot-starter-cache"
Tang Cheng91ca2772019-12-16 08:59:52 +080069 implementation "org.springframework.social:spring-social-web:${springSocialVersion}"
Tang Cheng1d565842019-12-18 20:33:41 +080070 implementation "org.apache.kafka:kafka-streams"
71 implementation "org.springframework.kafka:spring-kafka"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080072
Tang Cheng91ca2772019-12-16 08:59:52 +080073 implementation "org.springframework.cloud:spring-cloud-starter"
74 implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
75 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix"
76 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard"
77
Tang Chenge7d3a0e2019-07-08 16:27:33 +080078 runtime("org.springframework.boot:spring-boot-devtools")
79
Tang Cheng91ca2772019-12-16 08:59:52 +080080 implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080081
Tang Cheng91ca2772019-12-16 08:59:52 +080082 implementation "org.apache.commons:commons-lang3:${lang3Version}"
83 implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}"
84 implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}"
qiaowei38b46162019-09-09 16:35:58 +080085
Tang Cheng91ca2772019-12-16 08:59:52 +080086 implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
87 implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar")
88 implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}"
qiaowei1657eef2019-07-22 17:50:33 +080089 /*支付宝SDK*/
Tang Cheng91ca2772019-12-16 08:59:52 +080090 implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080091
Tang Cheng91ca2772019-12-16 08:59:52 +080092 implementation "com.github.penggle:kaptcha:${kaptchaVersion}"
93 implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080094
Tang Chenge7d3a0e2019-07-08 16:27:33 +080095}
96