blob: 364856ca4b40a4e4a8106cffec0668e3a0ce9632 [file] [log] [blame]
qiaowei41f869c2019-08-08 15:01:29 +08001import java.text.SimpleDateFormat
2
Tang Chenge7d3a0e2019-07-08 16:27:33 +08003plugins {
Tang Cheng91ca2772019-12-16 08:59:52 +08004 id "java"
5 id "org.springframework.boot"
6 id "org.jetbrains.kotlin.jvm"
7 id "org.jetbrains.kotlin.plugin.jpa"
8 id "org.jetbrains.kotlin.plugin.spring"
9 id "com.palantir.docker"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080010}
11
Tang Chenge7d3a0e2019-07-08 16:27:33 +080012payapiVersion = gitVersion()
Tang Cheng1b745242019-07-25 09:28:16 +080013def details = versionDetails()
Tang Chenge7d3a0e2019-07-08 16:27:33 +080014
Tang Cheng91ca2772019-12-16 08:59:52 +080015def payapiStartClass = "com.supwisdom.dlpay.PayApiApplicationKt"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080016
17println("Build version: $payapiVersion")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080018
19bootJar {
Tang Cheng8beabcd2019-07-12 11:48:01 +080020 mainClassName = payapiStartClass
Tang Chenge7d3a0e2019-07-08 16:27:33 +080021 manifest {
Tang Cheng91ca2772019-12-16 08:59:52 +080022 attributes("Payapi-Version": payapiVersion,
23 "Payapi-Buildtime": new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date()))
Tang Chenge7d3a0e2019-07-08 16:27:33 +080024 }
25}
26
27jar {
Tang Cheng91ca2772019-12-16 08:59:52 +080028 baseName = "payapi"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080029}
30
Tang Cheng91ca2772019-12-16 08:59:52 +080031compileKotlin {
32 kotlinOptions {
33 freeCompilerArgs = ["-Xjsr305=strict"]
34 jvmTarget = jdkVersion
35 }
36}
37
38compileTestKotlin {
39 kotlinOptions {
40 freeCompilerArgs = ["-Xjsr305=strict"]
41 jvmTarget = jdkVersion
42 }
Tang Cheng468da542019-09-12 11:29:48 +080043}
44
Tang Chenge7d3a0e2019-07-08 16:27:33 +080045docker {
Tang Cheng1b745242019-07-25 09:28:16 +080046 def imageVersion
Xia Kaixiang910ebfa2019-10-12 17:48:43 +080047 if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) {
Tang Cheng91ca2772019-12-16 08:59:52 +080048 imageVersion = "dev"
Tang Cheng1b745242019-07-25 09:28:16 +080049 } else {
50 imageVersion = details.lastTag
51 }
Xia Kaixiang910ebfa2019-10-12 17:48:43 +080052 println("Docker image tag : " + imageVersion)
Tang Cheng91ca2772019-12-16 08:59:52 +080053 name "harbor.supwisdom.com/dali/payapi:" + imageVersion
Tang Chenge7d3a0e2019-07-08 16:27:33 +080054 println(jar.archivePath)
55 files jar.archivePath
56}
57
58docker.dependsOn(jar)
59
60dependencies {
Tang Cheng91ca2772019-12-16 08:59:52 +080061 implementation project(":payapi-common")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080062
Tang Cheng91ca2772019-12-16 08:59:52 +080063 implementation "org.springframework.boot:spring-boot-starter-web"
64 implementation "org.springframework.boot:spring-boot-starter-security"
65 implementation "org.springframework.boot:spring-boot-starter-cache"
66 implementation "org.springframework.boot:spring-boot-autoconfigure"
67 implementation "org.springframework.security:spring-security-oauth2-jose"
68 implementation "org.springframework.security:spring-security-oauth2-client"
69 implementation "org.springframework.security:spring-security-oauth2-jose"
Tang Cheng07b36f12019-12-16 11:41:58 +080070 implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure"
Tang Cheng91ca2772019-12-16 08:59:52 +080071 implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
72 implementation "org.springframework.session:spring-session-data-redis"
73 implementation "org.springframework.boot:spring-boot-starter-cache"
74 implementation "org.springframework.kafka:spring-kafka"
75 implementation "org.springframework.social:spring-social-web:${springSocialVersion}"
76 implementation "org.springframework.kafka:spring-kafka:${springKafkaVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080077
Tang Cheng91ca2772019-12-16 08:59:52 +080078 implementation "org.springframework.cloud:spring-cloud-starter"
79 implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
80 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix"
81 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard"
82
Tang Chenge7d3a0e2019-07-08 16:27:33 +080083 runtime("org.springframework.boot:spring-boot-devtools")
84
Tang Cheng91ca2772019-12-16 08:59:52 +080085 implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
Tang Chenge0537a72019-07-13 12:52:07 +080086 implementation 'org.bitbucket.b_c:jose4j:0.6.5'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080087 implementation 'com.github.penggle:kaptcha:2.3.2'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080088 implementation group: 'com.sun.jersey', name: 'jersey-client', version: '1.19'
89 implementation group: 'javax.servlet', name: 'jstl', version: '1.2'
90 implementation group: 'taglibs', name: 'standard', version: '1.1.2'
qiaoweidc92a3b2019-09-09 16:35:58 +080091 implementation files('libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar')
Xia Kaixiang6c9365e2019-07-31 15:44:51 +080092 implementation 'commons-beanutils:commons-beanutils:1.9.3'
Xia Kaixiang651763c2020-02-17 18:00:03 +080093 implementation 'com.eatthepath:java-otp:0.1.0'
Tang Cheng13911f92019-07-10 09:38:32 +080094 implementation project(':payapi-common')
Tang Chenge7d3a0e2019-07-08 16:27:33 +080095
Tang Cheng91ca2772019-12-16 08:59:52 +080096 implementation "org.apache.commons:commons-lang3:${lang3Version}"
97 implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}"
98 implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}"
qiaowei38b46162019-09-09 16:35:58 +080099
Tang Cheng91ca2772019-12-16 08:59:52 +0800100 implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
101 implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar")
102 implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}"
qiaowei1657eef2019-07-22 17:50:33 +0800103 /*支付宝SDK*/
Tang Cheng91ca2772019-12-16 08:59:52 +0800104 implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800105
Tang Cheng91ca2772019-12-16 08:59:52 +0800106 implementation "com.github.penggle:kaptcha:${kaptchaVersion}"
107 implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800108
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800109}
110
kaixiang.xia051c7d72020-07-08 14:46:17 +0800111tasks.withType(JavaCompile) {
112 options.encoding = "UTF-8"
Tang Cheng4f2bfd02019-09-12 11:29:48 +0800113}
114