blob: 58e4b113d8cbb7a5b4327e4386b988d841603880 [file] [log] [blame]
qiaowei41f869c2019-08-08 15:01:29 +08001import java.text.SimpleDateFormat
2
Tang Chenge7d3a0e2019-07-08 16:27:33 +08003plugins {
Tang Cheng790bb842019-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 Cheng790bb842019-12-16 08:59:52 +080012payapiVersion = version
Tang Chenge7d3a0e2019-07-08 16:27:33 +080013
Tang Cheng790bb842019-12-16 08:59:52 +080014def payapiStartClass = "com.supwisdom.dlpay.PayApiApplicationKt"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080015
16println("Build version: $payapiVersion")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080017
18bootJar {
Tang Cheng8beabcd2019-07-12 11:48:01 +080019 mainClassName = payapiStartClass
Tang Chenge7d3a0e2019-07-08 16:27:33 +080020 manifest {
Tang Cheng790bb842019-12-16 08:59:52 +080021 attributes("Payapi-Version": payapiVersion,
22 "Payapi-Buildtime": new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date()))
Tang Chenge7d3a0e2019-07-08 16:27:33 +080023 }
24}
25
26jar {
Tang Cheng790bb842019-12-16 08:59:52 +080027 baseName = "payapi"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080028}
29
Tang Cheng790bb842019-12-16 08:59:52 +080030compileKotlin {
31 kotlinOptions {
32 freeCompilerArgs = ["-Xjsr305=strict"]
33 jvmTarget = jdkVersion
34 }
35}
36
37compileTestKotlin {
38 kotlinOptions {
39 freeCompilerArgs = ["-Xjsr305=strict"]
40 jvmTarget = jdkVersion
41 }
Tang Cheng468da542019-09-12 11:29:48 +080042}
43
Tang Chenge7d3a0e2019-07-08 16:27:33 +080044docker {
Tang Cheng1b745242019-07-25 09:28:16 +080045 def imageVersion
Xia Kaixiang910ebfa2019-10-12 17:48:43 +080046 if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) {
Tang Cheng790bb842019-12-16 08:59:52 +080047 imageVersion = "dev"
Tang Cheng1b745242019-07-25 09:28:16 +080048 } else {
49 imageVersion = details.lastTag
50 }
Xia Kaixiang910ebfa2019-10-12 17:48:43 +080051 println("Docker image tag : " + imageVersion)
Tang Cheng790bb842019-12-16 08:59:52 +080052 name "harbor.supwisdom.com/dali/payapi:" + imageVersion
Tang Chenge7d3a0e2019-07-08 16:27:33 +080053 println(jar.archivePath)
54 files jar.archivePath
55}
56
57docker.dependsOn(jar)
58
59dependencies {
Tang Cheng790bb842019-12-16 08:59:52 +080060 implementation project(":payapi-common")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080061
Tang Cheng790bb842019-12-16 08:59:52 +080062 implementation "org.springframework.boot:spring-boot-starter-web"
63 implementation "org.springframework.boot:spring-boot-starter-security"
64 implementation "org.springframework.boot:spring-boot-starter-cache"
65 implementation "org.springframework.boot:spring-boot-autoconfigure"
66 implementation "org.springframework.security:spring-security-oauth2-jose"
67 implementation "org.springframework.security:spring-security-oauth2-client"
68 implementation "org.springframework.security:spring-security-oauth2-jose"
69 implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.5.RELEASE"
70 implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
71 implementation "org.springframework.session:spring-session-data-redis"
72 implementation "org.springframework.boot:spring-boot-starter-cache"
73 implementation "org.springframework.kafka:spring-kafka"
74 implementation "org.springframework.social:spring-social-web:1.1.6.RELEASE"
75 implementation "org.springframework.kafka:spring-kafka:2.2.8.RELEASE"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080076
Tang Cheng790bb842019-12-16 08:59:52 +080077 implementation "org.springframework.cloud:spring-cloud-starter"
78 implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
79 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix"
80 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard"
81
Tang Chenge7d3a0e2019-07-08 16:27:33 +080082 runtime("org.springframework.boot:spring-boot-devtools")
83
Tang Cheng790bb842019-12-16 08:59:52 +080084 implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
85 implementation "commons-codec:commons-codec:${commonCodecVersion}"
86 implementation "org.apache.commons:commons-lang3:${lang3Version}"
87 implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}"
88 implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080089
qiaowei38b46162019-09-09 16:35:58 +080090
Tang Cheng790bb842019-12-16 08:59:52 +080091
92 implementation "com.jcabi:jcabi-manifests:${jcabiManifestsVersion}"
93 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 Cheng790bb842019-12-16 08:59:52 +080097 implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080098
Tang Cheng790bb842019-12-16 08:59:52 +080099 implementation "com.github.penggle:kaptcha:${kaptchaVersion}"
100 implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}"
101 implementation "javax.servlet:jstl:1.2"
102 implementation "taglibs:standard:1.1.2"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800103
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800104}
105