blob: 7e7d2ca41f271da67ee50cf43d04a8cd8cb8555e [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
Tang Chenge4032902019-12-19 12:38:08 +080055configurations {
56 developmentOnly
57 runtimeClasspath {
58 extendsFrom developmentOnly
59 }
60}
61
Tang Chenge7d3a0e2019-07-08 16:27:33 +080062dependencies {
Tang Cheng91ca2772019-12-16 08:59:52 +080063 implementation project(":payapi-common")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080064
Tang Cheng91ca2772019-12-16 08:59:52 +080065 implementation "org.springframework.boot:spring-boot-starter-web"
66 implementation "org.springframework.boot:spring-boot-starter-security"
67 implementation "org.springframework.boot:spring-boot-starter-cache"
68 implementation "org.springframework.boot:spring-boot-autoconfigure"
69 implementation "org.springframework.security:spring-security-oauth2-jose"
70 implementation "org.springframework.security:spring-security-oauth2-client"
71 implementation "org.springframework.security:spring-security-oauth2-jose"
Tang Cheng07b36f12019-12-16 11:41:58 +080072 implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure"
Tang Cheng91ca2772019-12-16 08:59:52 +080073 implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
74 implementation "org.springframework.session:spring-session-data-redis"
75 implementation "org.springframework.boot:spring-boot-starter-cache"
Tang Cheng91ca2772019-12-16 08:59:52 +080076 implementation "org.springframework.social:spring-social-web:${springSocialVersion}"
Tang Cheng1d565842019-12-18 20:33:41 +080077 implementation "org.apache.kafka:kafka-streams"
78 implementation "org.springframework.kafka:spring-kafka"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080079
Tang Cheng91ca2772019-12-16 08:59:52 +080080 implementation "org.springframework.cloud:spring-cloud-starter"
81 implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
82 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix"
83 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard"
84
Tang Chenge4032902019-12-19 12:38:08 +080085 developmentOnly("org.springframework.boot:spring-boot-devtools")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080086
Tang Cheng91ca2772019-12-16 08:59:52 +080087 implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080088
Tang Cheng91ca2772019-12-16 08:59:52 +080089 implementation "org.apache.commons:commons-lang3:${lang3Version}"
90 implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}"
91 implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}"
qiaowei38b46162019-09-09 16:35:58 +080092
Tang Cheng91ca2772019-12-16 08:59:52 +080093 implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
94 implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar")
95 implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}"
qiaowei1657eef2019-07-22 17:50:33 +080096 /*支付宝SDK*/
Tang Cheng91ca2772019-12-16 08:59:52 +080097 implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080098
Tang Cheng91ca2772019-12-16 08:59:52 +080099 implementation "com.github.penggle:kaptcha:${kaptchaVersion}"
100 implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800101
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800102}
103