blob: 33dc6c17c1d604deeaa1e16dc9a35cbf53d9c609 [file] [log] [blame]
qiaowei1a9ea852019-08-08 15:01:29 +08001import java.text.SimpleDateFormat
2
Tang Chenge7d3a0e2019-07-08 16:27:33 +08003plugins {
4 id 'java'
Tang Cheng22731312019-07-12 11:19:30 +08005 id 'org.springframework.boot'
6 id 'org.jetbrains.kotlin.jvm'
Tang Chenge7d3a0e2019-07-08 16:27:33 +08007 id 'org.jetbrains.kotlin.plugin.jpa' version '1.3.31'
Tang Cheng22731312019-07-12 11:19:30 +08008 id 'org.jetbrains.kotlin.plugin.spring'
9 id "com.palantir.git-version"
10 id 'com.palantir.docker'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080011}
12
13apply plugin: 'java'
14apply plugin: 'io.spring.dependency-management'
15
16payapiVersion = gitVersion()
Tang Cheng1b745242019-07-25 09:28:16 +080017def details = versionDetails()
Tang Chenge7d3a0e2019-07-08 16:27:33 +080018
Tang Cheng40993e12019-07-08 16:38:51 +080019group = rootProject.group
Tang Chenge7d3a0e2019-07-08 16:27:33 +080020version = '1'
21sourceCompatibility = jdkVersion
Tang Cheng8beabcd2019-07-12 11:48:01 +080022def payapiStartClass = 'com.supwisdom.dlpay.PayApiApplicationKt'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080023
24println("Build version: $payapiVersion")
Tang Chenge7d3a0e2019-07-08 16:27:33 +080025
26bootJar {
Tang Cheng8beabcd2019-07-12 11:48:01 +080027 mainClassName = payapiStartClass
Tang Chenge7d3a0e2019-07-08 16:27:33 +080028 manifest {
qiaowei1a9ea852019-08-08 15:01:29 +080029 attributes('Payapi-Version': payapiVersion,'Payapi-Buildtime':new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date()))
Tang Chenge7d3a0e2019-07-08 16:27:33 +080030 }
31}
32
33jar {
34 baseName = 'payapi'
35}
36
37docker {
Tang Cheng1b745242019-07-25 09:28:16 +080038 def imageVersion
Xia Kaixianga7dc02e2019-10-12 17:48:43 +080039 if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) {
Tang Cheng1b745242019-07-25 09:28:16 +080040 imageVersion = 'dev'
41 } else {
42 imageVersion = details.lastTag
43 }
Xia Kaixianga7dc02e2019-10-12 17:48:43 +080044 println("Docker image tag : " + imageVersion)
Tang Cheng20b53b52019-07-25 09:35:41 +080045 name 'harbor.supwisdom.com/dali/payapi:' + imageVersion
Tang Chenge7d3a0e2019-07-08 16:27:33 +080046 println(jar.archivePath)
47 files jar.archivePath
48}
49
50docker.dependsOn(jar)
51
52dependencies {
53 implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
54 implementation 'org.springframework.boot:spring-boot-starter-data-redis'
55 implementation 'org.springframework.boot:spring-boot-starter-web'
56 implementation 'org.springframework.boot:spring-boot-starter-security'
57 implementation 'org.springframework.boot:spring-boot-starter-cache'
58 implementation 'org.springframework.boot:spring-boot-autoconfigure'
59 implementation 'org.springframework.security:spring-security-oauth2-jose'
60 implementation 'org.springframework.security:spring-security-oauth2-client'
61 implementation 'org.springframework.security:spring-security-oauth2-jose'
62 implementation 'org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.5.RELEASE'
63 implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
64 implementation 'org.springframework.session:spring-session-data-redis'
65 implementation 'org.springframework.boot:spring-boot-starter-cache'
Tang Cheng432d47c2019-08-10 13:18:36 +080066 implementation 'org.springframework.kafka:spring-kafka'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080067 implementation 'org.springframework.social:spring-social-web:1.1.6.RELEASE'
68 implementation 'org.jetbrains.kotlin:kotlin-reflect'
69 implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
70 implementation 'commons-codec:commons-codec:1.12'
Tang Chenge7436342019-07-11 16:04:58 +080071 implementation 'org.apache.commons:commons-lang3:3.9'
Tang Chengacb93a62019-07-18 22:04:48 +080072 implementation 'net.javacrumbs.shedlock:shedlock-spring:2.5.0'
73 implementation 'net.javacrumbs.shedlock:shedlock-provider-redis-spring:2.5.0'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080074
75 implementation 'org.springframework.cloud:spring-cloud-starter-consul-discovery:2.1.2.RELEASE'
76
77 implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
qiaoweia3153602019-08-08 15:05:42 +080078 implementation 'org.springframework.kafka:spring-kafka:2.2.8.RELEASE'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080079 runtime("org.springframework.boot:spring-boot-devtools")
80
81 implementation 'org.postgresql:postgresql:42.2.5'
82 implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
83 implementation 'com.jcabi:jcabi-manifests:1.1'
Tang Chenge0537a72019-07-13 12:52:07 +080084 implementation 'org.bitbucket.b_c:jose4j:0.6.5'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080085 implementation 'io.github.microutils:kotlin-logging:1.6.26'
86 implementation 'org.slf4j:slf4j-parent:1.7.26'
87 implementation 'com.github.penggle:kaptcha:2.3.2'
88 implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
89 implementation group: 'com.sun.jersey', name: 'jersey-client', version: '1.19'
90 implementation group: 'javax.servlet', name: 'jstl', version: '1.2'
91 implementation group: 'taglibs', name: 'standard', version: '1.1.2'
Tang Cheng5f834db2019-07-29 11:00:13 +080092 implementation group: 'commons-codec', name: 'commons-codec', version: '1.13'
qiaoweidc92a3b2019-09-09 16:35:58 +080093 implementation files('libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar')
Tang Cheng5f834db2019-07-29 11:00:13 +080094// implementation files('libs/ojdbc6.jar')
Tang Chenge7d3a0e2019-07-08 16:27:33 +080095 implementation 'commons-dbcp:commons-dbcp:1.4'
Xia Kaixiang6c9365e2019-07-31 15:44:51 +080096 implementation 'commons-beanutils:commons-beanutils:1.9.3'
Tang Chenge7d3a0e2019-07-08 16:27:33 +080097
qiaoweidc92a3b2019-09-09 16:35:58 +080098 implementation 'log4j:log4j:1.2.17'
99 implementation 'com.alibaba:fastjson:1.2.60'
100
Tang Cheng13911f92019-07-10 09:38:32 +0800101 implementation project(':payapi-common')
qiaowei1657eef2019-07-22 17:50:33 +0800102 /*支付宝SDK*/
103 implementation group: 'com.alipay.sdk', name: 'alipay-sdk-java', version: '3.7.110.ALL'
Tang Chenge7d3a0e2019-07-08 16:27:33 +0800104
105 annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
106 annotationProcessor 'org.projectlombok:lombok:1.18.8'
107 compileOnly 'org.projectlombok:lombok:1.18.8'
108
109// providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
110 testImplementation 'org.springframework.boot:spring-boot-starter-test'
111 testImplementation 'io.rest-assured:rest-assured:3.3.0'
112 testImplementation 'io.rest-assured:spring-mock-mvc:3.3.0'
113 testImplementation 'org.hamcrest:hamcrest:2.1'
114}
115
116compileKotlin {
117 kotlinOptions {
118 freeCompilerArgs = ['-Xjsr305=strict']
119 jvmTarget = jdkVersion
120 }
121}
122
123compileTestKotlin {
124 kotlinOptions {
125 freeCompilerArgs = ['-Xjsr305=strict']
126 jvmTarget = jdkVersion
127 }
128}