qiaowei | 1a9ea85 | 2019-08-08 15:01:29 +0800 | [diff] [blame] | 1 | import java.text.SimpleDateFormat |
| 2 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 3 | plugins { |
| 4 | id 'java' |
Tang Cheng | 2273131 | 2019-07-12 11:19:30 +0800 | [diff] [blame] | 5 | id 'org.springframework.boot' |
Tang Cheng | 4f2bfd0 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 6 | id 'io.spring.dependency-management' |
Tang Cheng | 2273131 | 2019-07-12 11:19:30 +0800 | [diff] [blame] | 7 | id 'org.jetbrains.kotlin.jvm' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 8 | id 'org.jetbrains.kotlin.plugin.jpa' version '1.3.31' |
Tang Cheng | 2273131 | 2019-07-12 11:19:30 +0800 | [diff] [blame] | 9 | id 'org.jetbrains.kotlin.plugin.spring' |
| 10 | id "com.palantir.git-version" |
| 11 | id 'com.palantir.docker' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 12 | } |
| 13 | |
binquan.qiuu | 6cf8c4f | 2020-07-08 11:17:48 +0800 | [diff] [blame] | 14 | tasks.withType(JavaCompile) { |
| 15 | options.encoding = "UTF-8" |
| 16 | } |
| 17 | |
| 18 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 19 | payapiVersion = gitVersion() |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 20 | def details = versionDetails() |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 21 | |
Tang Cheng | 40993e1 | 2019-07-08 16:38:51 +0800 | [diff] [blame] | 22 | group = rootProject.group |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 23 | version = '1' |
| 24 | sourceCompatibility = jdkVersion |
Tang Cheng | 8beabcd | 2019-07-12 11:48:01 +0800 | [diff] [blame] | 25 | def payapiStartClass = 'com.supwisdom.dlpay.PayApiApplicationKt' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 26 | |
| 27 | println("Build version: $payapiVersion") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 28 | |
| 29 | bootJar { |
Tang Cheng | 8beabcd | 2019-07-12 11:48:01 +0800 | [diff] [blame] | 30 | mainClassName = payapiStartClass |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 31 | manifest { |
Tang Cheng | 4f2bfd0 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 32 | attributes('Payapi-Version': payapiVersion, |
| 33 | 'Payapi-Buildtime': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())) |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 34 | } |
| 35 | } |
| 36 | |
| 37 | jar { |
| 38 | baseName = 'payapi' |
| 39 | } |
| 40 | |
Tang Cheng | 4f2bfd0 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 41 | ext { |
| 42 | set('springCloudVersion', "Greenwich.SR2") |
| 43 | } |
| 44 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 45 | docker { |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 46 | def imageVersion |
Xia Kaixiang | a7dc02e | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 47 | if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) { |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 48 | imageVersion = 'dev' |
| 49 | } else { |
| 50 | imageVersion = details.lastTag |
| 51 | } |
Xia Kaixiang | a7dc02e | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 52 | println("Docker image tag : " + imageVersion) |
Tang Cheng | 20b53b5 | 2019-07-25 09:35:41 +0800 | [diff] [blame] | 53 | name 'harbor.supwisdom.com/dali/payapi:' + imageVersion |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 54 | println(jar.archivePath) |
| 55 | files jar.archivePath |
| 56 | } |
| 57 | |
| 58 | docker.dependsOn(jar) |
| 59 | |
kaixiang.xia | 03919bd | 2020-10-28 18:19:09 +0800 | [diff] [blame] | 60 | repositories { |
| 61 | maven { |
| 62 | url "http://ykt-nx.supwisdom.com/repository/ecard-repo/" |
| 63 | credentials { |
| 64 | username 'ecard' |
| 65 | password 'Ecard4SUP' |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 70 | dependencies { |
| 71 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' |
| 72 | implementation 'org.springframework.boot:spring-boot-starter-data-redis' |
| 73 | implementation 'org.springframework.boot:spring-boot-starter-web' |
| 74 | implementation 'org.springframework.boot:spring-boot-starter-security' |
| 75 | implementation 'org.springframework.boot:spring-boot-starter-cache' |
| 76 | implementation 'org.springframework.boot:spring-boot-autoconfigure' |
| 77 | implementation 'org.springframework.security:spring-security-oauth2-jose' |
| 78 | implementation 'org.springframework.security:spring-security-oauth2-client' |
| 79 | implementation 'org.springframework.security:spring-security-oauth2-jose' |
| 80 | implementation 'org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.5.RELEASE' |
| 81 | implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' |
| 82 | implementation 'org.springframework.session:spring-session-data-redis' |
| 83 | implementation 'org.springframework.boot:spring-boot-starter-cache' |
Tang Cheng | 432d47c | 2019-08-10 13:18:36 +0800 | [diff] [blame] | 84 | implementation 'org.springframework.kafka:spring-kafka' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 85 | implementation 'org.springframework.social:spring-social-web:1.1.6.RELEASE' |
Tang Cheng | 4f2bfd0 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 86 | implementation 'org.springframework.kafka:spring-kafka:2.2.8.RELEASE' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 87 | implementation 'org.jetbrains.kotlin:kotlin-reflect' |
| 88 | implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' |
| 89 | implementation 'commons-codec:commons-codec:1.12' |
Tang Cheng | e743634 | 2019-07-11 16:04:58 +0800 | [diff] [blame] | 90 | implementation 'org.apache.commons:commons-lang3:3.9' |
Tang Cheng | acb93a6 | 2019-07-18 22:04:48 +0800 | [diff] [blame] | 91 | implementation 'net.javacrumbs.shedlock:shedlock-spring:2.5.0' |
| 92 | implementation 'net.javacrumbs.shedlock:shedlock-provider-redis-spring:2.5.0' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 93 | |
Tang Cheng | 4f2bfd0 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 94 | implementation 'org.springframework.cloud:spring-cloud-starter' |
| 95 | implementation 'org.springframework.cloud:spring-cloud-starter-consul-discovery' |
| 96 | implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix' |
| 97 | implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 98 | |
| 99 | implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 100 | runtime("org.springframework.boot:spring-boot-devtools") |
| 101 | |
| 102 | implementation 'org.postgresql:postgresql:42.2.5' |
| 103 | implementation 'com.fasterxml.jackson.module:jackson-module-kotlin' |
| 104 | implementation 'com.jcabi:jcabi-manifests:1.1' |
Tang Cheng | e0537a7 | 2019-07-13 12:52:07 +0800 | [diff] [blame] | 105 | implementation 'org.bitbucket.b_c:jose4j:0.6.5' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 106 | implementation 'io.github.microutils:kotlin-logging:1.6.26' |
| 107 | implementation 'org.slf4j:slf4j-parent:1.7.26' |
| 108 | implementation 'com.github.penggle:kaptcha:2.3.2' |
| 109 | implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5' |
| 110 | implementation group: 'com.sun.jersey', name: 'jersey-client', version: '1.19' |
| 111 | implementation group: 'javax.servlet', name: 'jstl', version: '1.2' |
| 112 | implementation group: 'taglibs', name: 'standard', version: '1.1.2' |
Tang Cheng | 5f834db | 2019-07-29 11:00:13 +0800 | [diff] [blame] | 113 | implementation group: 'commons-codec', name: 'commons-codec', version: '1.13' |
qiaowei | dc92a3b | 2019-09-09 16:35:58 +0800 | [diff] [blame] | 114 | implementation files('libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar') |
Tang Cheng | 5f834db | 2019-07-29 11:00:13 +0800 | [diff] [blame] | 115 | // implementation files('libs/ojdbc6.jar') |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 116 | implementation 'commons-dbcp:commons-dbcp:1.4' |
Xia Kaixiang | 6c9365e | 2019-07-31 15:44:51 +0800 | [diff] [blame] | 117 | implementation 'commons-beanutils:commons-beanutils:1.9.3' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 118 | |
qiaowei | dc92a3b | 2019-09-09 16:35:58 +0800 | [diff] [blame] | 119 | implementation 'log4j:log4j:1.2.17' |
| 120 | implementation 'com.alibaba:fastjson:1.2.60' |
| 121 | |
kaixiang.xia | 427418f | 2020-11-05 14:57:08 +0800 | [diff] [blame] | 122 | implementation 'com.eatthepath:java-otp:0.2.0' |
Tang Cheng | 13911f9 | 2019-07-10 09:38:32 +0800 | [diff] [blame] | 123 | implementation project(':payapi-common') |
qiaowei | 1657eef | 2019-07-22 17:50:33 +0800 | [diff] [blame] | 124 | /*支付宝SDK*/ |
| 125 | implementation group: 'com.alipay.sdk', name: 'alipay-sdk-java', version: '3.7.110.ALL' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 126 | |
kaixiang.xia | 03919bd | 2020-10-28 18:19:09 +0800 | [diff] [blame] | 127 | /*大理二维码jar*/ |
kaixiang.xia | ee7fa4c | 2020-12-03 15:29:04 +0800 | [diff] [blame] | 128 | implementation 'com.supwisdom:dlsmk-qrcode:1.3.5' |
kaixiang.xia | 03919bd | 2020-10-28 18:19:09 +0800 | [diff] [blame] | 129 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 130 | annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" |
| 131 | annotationProcessor 'org.projectlombok:lombok:1.18.8' |
| 132 | compileOnly 'org.projectlombok:lombok:1.18.8' |
| 133 | |
| 134 | // providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' |
| 135 | testImplementation 'org.springframework.boot:spring-boot-starter-test' |
| 136 | testImplementation 'io.rest-assured:rest-assured:3.3.0' |
| 137 | testImplementation 'io.rest-assured:spring-mock-mvc:3.3.0' |
| 138 | testImplementation 'org.hamcrest:hamcrest:2.1' |
| 139 | } |
| 140 | |
Tang Cheng | 4f2bfd0 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 141 | dependencyManagement { |
| 142 | imports { |
| 143 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" |
| 144 | } |
| 145 | } |
| 146 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 147 | compileKotlin { |
| 148 | kotlinOptions { |
| 149 | freeCompilerArgs = ['-Xjsr305=strict'] |
| 150 | jvmTarget = jdkVersion |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | compileTestKotlin { |
| 155 | kotlinOptions { |
| 156 | freeCompilerArgs = ['-Xjsr305=strict'] |
| 157 | jvmTarget = jdkVersion |
| 158 | } |
| 159 | } |