blob: 9dcd2e480eb15d9f2514e58d17d21dae555c209e [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 Cheng307ec572019-12-25 10:03:05 +080020 def standalone = ""
21 if (rootProject.hasProperty("no-multi-tenant")) {
22 standalone = "-stangalone-"
23 }
24 archiveFileName = "${project.name}${standalone}-${buildVersion}.${archiveExtension.getOrElse('.jar')}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +080025 manifest {
Tang Chengf36d7252019-12-17 14:14:50 +080026 attributes("Payapi-Version": buildVersion,
Tang Cheng1d565842019-12-18 20:33:41 +080027 "Payapi-Buildtime": buildTime)
Tang Chenge7d3a0e2019-07-08 16:27:33 +080028 }
29}
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 }
Tang Cheng1d565842019-12-18 20:33:41 +080052 println("Docker image tag : ${imageVersion}")
53 name "${dockerRegistry}/payapi:${imageVersion}"
54 println(jar.archiveFile.get())
55 files jar.archiveFile.get()
Tang Chenge7d3a0e2019-07-08 16:27:33 +080056}
57
58docker.dependsOn(jar)
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}"
110
Tang Cheng91ca2772019-12-16 08:59:52 +0800111 implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
112 implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar")
113 implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}"
qiaowei1657eef2019-07-22 17:50:33 +0800114 /*支付宝SDK*/
Tang Cheng91ca2772019-12-16 08:59:52 +0800115 implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800116
Tang Cheng91ca2772019-12-16 08:59:52 +0800117 implementation "com.github.penggle:kaptcha:${kaptchaVersion}"
118 implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}"
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800119
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800120}
121