blob: d8f169c4c9a2d846bb58d458f2cdc284146ea9fb [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
Tang Cheng11be1ac2020-01-10 15:31:25 +080017
Tang Chenge7d3a0e2019-07-08 16:27:33 +080018bootJar {
Tang Cheng1d565842019-12-18 20:33:41 +080019 enabled = true
Tang Cheng8beabcd2019-07-12 11:48:01 +080020 mainClassName = payapiStartClass
Tang Cheng11be1ac2020-01-10 15:31:25 +080021// def standalone = ""
22// if (rootProject.hasProperty("no-multi-tenant")) {
23// standalone = "-stangalone-"
24//
25 archiveFileName = "${project.name}-${buildVersion}.${archiveExtension.getOrElse('.jar')}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080026 manifest {
Tang Chengf36d7252019-12-17 14:14:50 +080027 attributes("Payapi-Version": buildVersion,
Tang Cheng1d565842019-12-18 20:33:41 +080028 "Payapi-Buildtime": buildTime)
Tang Chenge7d3a0e2019-07-08 16:27:33 +080029 }
30}
31
Tang Cheng91ca2772019-12-16 08:59:52 +080032compileKotlin {
33 kotlinOptions {
34 freeCompilerArgs = ["-Xjsr305=strict"]
35 jvmTarget = jdkVersion
36 }
37}
38
39compileTestKotlin {
40 kotlinOptions {
41 freeCompilerArgs = ["-Xjsr305=strict"]
42 jvmTarget = jdkVersion
43 }
Tang Cheng468da542019-09-12 11:29:48 +080044}
45
Tang Chenge7d3a0e2019-07-08 16:27:33 +080046docker {
Tang Cheng1b745242019-07-25 09:28:16 +080047 def imageVersion
Xia Kaixiang910ebfa2019-10-12 17:48:43 +080048 if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) {
Tang Cheng91ca2772019-12-16 08:59:52 +080049 imageVersion = "dev"
Tang Cheng1b745242019-07-25 09:28:16 +080050 } else {
51 imageVersion = details.lastTag
52 }
Tang Cheng1d565842019-12-18 20:33:41 +080053 println("Docker image tag : ${imageVersion}")
54 name "${dockerRegistry}/payapi:${imageVersion}"
Tang Cheng11be1ac2020-01-10 15:31:25 +080055 println(bootJar.archiveFile.get())
56 files bootJar.archiveFile.get()
57 buildArgs([BUILD_VERSION: "${buildVersion}"])
Tang Chenge7d3a0e2019-07-08 16:27:33 +080058}
59
Tang Chenge4032902019-12-19 12:38:08 +080060configurations {
61 developmentOnly
62 runtimeClasspath {
63 extendsFrom developmentOnly
64 }
65}
66
Tang Cheng62d405b2019-12-24 15:39:45 +080067repositories {
68 maven {
69 url "http://ykt-nx.supwisdom.com/repository/ecard-repo/"
70 credentials {
71 username "${nxUser}"
72 password "${nxPassword}"
73 }
74 }
75}
76
Tang Chenge7d3a0e2019-07-08 16:27:33 +080077dependencies {
Tang Cheng91ca2772019-12-16 08:59:52 +080078 implementation project(":payapi-common")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080079
Tang Cheng91ca2772019-12-16 08:59:52 +080080 implementation "org.springframework.boot:spring-boot-starter-web"
81 implementation "org.springframework.boot:spring-boot-starter-security"
82 implementation "org.springframework.boot:spring-boot-starter-cache"
83 implementation "org.springframework.boot:spring-boot-autoconfigure"
84 implementation "org.springframework.security:spring-security-oauth2-jose"
85 implementation "org.springframework.security:spring-security-oauth2-client"
86 implementation "org.springframework.security:spring-security-oauth2-jose"
Tang Cheng07b36f12019-12-16 11:41:58 +080087 implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure"
Tang Cheng91ca2772019-12-16 08:59:52 +080088 implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
89 implementation "org.springframework.session:spring-session-data-redis"
90 implementation "org.springframework.boot:spring-boot-starter-cache"
Tang Cheng91ca2772019-12-16 08:59:52 +080091 implementation "org.springframework.social:spring-social-web:${springSocialVersion}"
Tang Cheng1d565842019-12-18 20:33:41 +080092 implementation "org.apache.kafka:kafka-streams"
93 implementation "org.springframework.kafka:spring-kafka"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080094
Tang Cheng91ca2772019-12-16 08:59:52 +080095 implementation "org.springframework.cloud:spring-cloud-starter"
96 implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
97 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix"
98 implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard"
99
Tang Chenge4032902019-12-19 12:38:08 +0800100 developmentOnly("org.springframework.boot:spring-boot-devtools")
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800101
Tang Cheng91ca2772019-12-16 08:59:52 +0800102 implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800103
Tang Cheng91ca2772019-12-16 08:59:52 +0800104 implementation "org.apache.commons:commons-lang3:${lang3Version}"
105 implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}"
106 implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}"
qiaowei38b46162019-09-09 16:35:58 +0800107
Tang Cheng62d405b2019-12-24 15:39:45 +0800108 implementation "com.supwisdom:multi-tenant-core:${multiTenantLibVersion}"
109 implementation "com.supwisdom:multi-tenant-datasource:${multiTenantLibVersion}"
Tang Cheng11be1ac2020-01-10 15:31:25 +0800110 implementation "com.supwisdom:multi-tenant-jwt:${multiTenantLibVersion}"
Tang Cheng62d405b2019-12-24 15:39:45 +0800111
Tang Cheng91ca2772019-12-16 08:59:52 +0800112 implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
113 implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar")
114 implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}"
qiaowei1657eef2019-07-22 17:50:33 +0800115 /*支付宝SDK*/
Tang Cheng91ca2772019-12-16 08:59:52 +0800116 implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800117
Tang Cheng91ca2772019-12-16 08:59:52 +0800118 implementation "com.github.penggle:kaptcha:${kaptchaVersion}"
119 implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800120
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800121}
122