Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 1 | plugins { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 2 | 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 Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 8 | } |
| 9 | |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 10 | apply plugin: 'io.spring.dependency-management' |
| 11 | apply plugin: 'kotlin' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 12 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 13 | def payapiStartClass = "com.supwisdom.dlpay.PayApiApplicationKt" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 14 | |
Tang Cheng | f36d725 | 2019-12-17 14:14:50 +0800 | [diff] [blame] | 15 | println("Build version: $buildVersion") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 16 | |
Tang Cheng | 11be1ac | 2020-01-10 15:31:25 +0800 | [diff] [blame] | 17 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 18 | bootJar { |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 19 | enabled = true |
Tang Cheng | 8beabcd | 2019-07-12 11:48:01 +0800 | [diff] [blame] | 20 | mainClassName = payapiStartClass |
Tang Cheng | 11be1ac | 2020-01-10 15:31:25 +0800 | [diff] [blame] | 21 | archiveFileName = "${project.name}-${buildVersion}.${archiveExtension.getOrElse('.jar')}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 22 | manifest { |
Tang Cheng | f36d725 | 2019-12-17 14:14:50 +0800 | [diff] [blame] | 23 | attributes("Payapi-Version": buildVersion, |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 24 | "Payapi-Buildtime": buildTime) |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 25 | } |
| 26 | } |
| 27 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 28 | compileKotlin { |
| 29 | kotlinOptions { |
| 30 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 31 | jvmTarget = jdkVersion |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | compileTestKotlin { |
| 36 | kotlinOptions { |
| 37 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 38 | jvmTarget = jdkVersion |
| 39 | } |
Tang Cheng | 468da54 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 40 | } |
| 41 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 42 | docker { |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 43 | def imageVersion |
Xia Kaixiang | 910ebfa | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 44 | if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 45 | imageVersion = "dev" |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 46 | } else { |
| 47 | imageVersion = details.lastTag |
| 48 | } |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 49 | println("Docker image tag : ${imageVersion}") |
| 50 | name "${dockerRegistry}/payapi:${imageVersion}" |
Tang Cheng | 11be1ac | 2020-01-10 15:31:25 +0800 | [diff] [blame] | 51 | println(bootJar.archiveFile.get()) |
| 52 | files bootJar.archiveFile.get() |
| 53 | buildArgs([BUILD_VERSION: "${buildVersion}"]) |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 54 | } |
| 55 | |
Tang Cheng | e403290 | 2019-12-19 12:38:08 +0800 | [diff] [blame] | 56 | configurations { |
| 57 | developmentOnly |
| 58 | runtimeClasspath { |
| 59 | extendsFrom developmentOnly |
| 60 | } |
| 61 | } |
| 62 | |
Tang Cheng | 62d405b | 2019-12-24 15:39:45 +0800 | [diff] [blame] | 63 | repositories { |
| 64 | maven { |
| 65 | url "http://ykt-nx.supwisdom.com/repository/ecard-repo/" |
| 66 | credentials { |
| 67 | username "${nxUser}" |
| 68 | password "${nxPassword}" |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 73 | dependencies { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 74 | implementation project(":payapi-common") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 75 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 76 | implementation "org.springframework.boot:spring-boot-starter-web" |
| 77 | implementation "org.springframework.boot:spring-boot-starter-security" |
| 78 | implementation "org.springframework.boot:spring-boot-starter-cache" |
| 79 | implementation "org.springframework.boot:spring-boot-autoconfigure" |
| 80 | implementation "org.springframework.security:spring-security-oauth2-jose" |
| 81 | implementation "org.springframework.security:spring-security-oauth2-client" |
| 82 | implementation "org.springframework.security:spring-security-oauth2-jose" |
Tang Cheng | 07b36f1 | 2019-12-16 11:41:58 +0800 | [diff] [blame] | 83 | implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 84 | implementation "org.springframework.boot:spring-boot-starter-thymeleaf" |
| 85 | implementation "org.springframework.session:spring-session-data-redis" |
| 86 | implementation "org.springframework.boot:spring-boot-starter-cache" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 87 | implementation "org.springframework.social:spring-social-web:${springSocialVersion}" |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 88 | implementation "org.apache.kafka:kafka-streams" |
| 89 | implementation "org.springframework.kafka:spring-kafka" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 90 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 91 | implementation "org.springframework.cloud:spring-cloud-starter" |
| 92 | implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery" |
| 93 | implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix" |
| 94 | implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard" |
| 95 | |
Tang Cheng | e403290 | 2019-12-19 12:38:08 +0800 | [diff] [blame] | 96 | developmentOnly("org.springframework.boot:spring-boot-devtools") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 97 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 98 | implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 99 | |
Tang Cheng | cc4299d | 2020-03-12 15:55:12 +0800 | [diff] [blame^] | 100 | implementation group: 'io.swagger', name: 'swagger-annotations', version: swaggerVersion |
| 101 | implementation group: 'io.springfox', name: 'springfox-swagger2', version: springfoxVersion |
| 102 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 103 | implementation "org.apache.commons:commons-lang3:${lang3Version}" |
| 104 | implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}" |
| 105 | implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}" |
qiaowei | 38b4616 | 2019-09-09 16:35:58 +0800 | [diff] [blame] | 106 | |
Tang Cheng | 62d405b | 2019-12-24 15:39:45 +0800 | [diff] [blame] | 107 | implementation "com.supwisdom:multi-tenant-core:${multiTenantLibVersion}" |
| 108 | implementation "com.supwisdom:multi-tenant-datasource:${multiTenantLibVersion}" |
Tang Cheng | 11be1ac | 2020-01-10 15:31:25 +0800 | [diff] [blame] | 109 | implementation "com.supwisdom:multi-tenant-jwt:${multiTenantLibVersion}" |
Tang Cheng | 7b61058 | 2020-02-18 21:28:33 +0800 | [diff] [blame] | 110 | implementation "com.supwisdom:multi-tenant-task:${multiTenantLibVersion}" |
Tang Cheng | 62d405b | 2019-12-24 15:39:45 +0800 | [diff] [blame] | 111 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 112 | 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}" |
qiaowei | 1657eef | 2019-07-22 17:50:33 +0800 | [diff] [blame] | 115 | /*支付宝SDK*/ |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 116 | implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 117 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 118 | implementation "com.github.penggle:kaptcha:${kaptchaVersion}" |
| 119 | implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 120 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 121 | } |
| 122 | |