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 | // def standalone = "" |
| 22 | // if (rootProject.hasProperty("no-multi-tenant")) { |
| 23 | // standalone = "-stangalone-" |
| 24 | // |
| 25 | archiveFileName = "${project.name}-${buildVersion}.${archiveExtension.getOrElse('.jar')}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 26 | manifest { |
Tang Cheng | f36d725 | 2019-12-17 14:14:50 +0800 | [diff] [blame] | 27 | attributes("Payapi-Version": buildVersion, |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 28 | "Payapi-Buildtime": buildTime) |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 29 | } |
| 30 | } |
| 31 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 32 | compileKotlin { |
| 33 | kotlinOptions { |
| 34 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 35 | jvmTarget = jdkVersion |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | compileTestKotlin { |
| 40 | kotlinOptions { |
| 41 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 42 | jvmTarget = jdkVersion |
| 43 | } |
Tang Cheng | 468da54 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 44 | } |
| 45 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 46 | docker { |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 47 | def imageVersion |
Xia Kaixiang | 910ebfa | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 48 | if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 49 | imageVersion = "dev" |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 50 | } else { |
| 51 | imageVersion = details.lastTag |
| 52 | } |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 53 | println("Docker image tag : ${imageVersion}") |
| 54 | name "${dockerRegistry}/payapi:${imageVersion}" |
Tang Cheng | 11be1ac | 2020-01-10 15:31:25 +0800 | [diff] [blame] | 55 | println(bootJar.archiveFile.get()) |
| 56 | files bootJar.archiveFile.get() |
| 57 | buildArgs([BUILD_VERSION: "${buildVersion}"]) |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 58 | } |
| 59 | |
Tang Cheng | e403290 | 2019-12-19 12:38:08 +0800 | [diff] [blame] | 60 | configurations { |
| 61 | developmentOnly |
| 62 | runtimeClasspath { |
| 63 | extendsFrom developmentOnly |
| 64 | } |
| 65 | } |
| 66 | |
Tang Cheng | 62d405b | 2019-12-24 15:39:45 +0800 | [diff] [blame] | 67 | repositories { |
| 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 Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 77 | dependencies { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 78 | implementation project(":payapi-common") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 79 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 80 | 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 Cheng | 07b36f1 | 2019-12-16 11:41:58 +0800 | [diff] [blame] | 87 | implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 88 | 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 Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 91 | implementation "org.springframework.social:spring-social-web:${springSocialVersion}" |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 92 | implementation "org.apache.kafka:kafka-streams" |
| 93 | implementation "org.springframework.kafka:spring-kafka" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 94 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 95 | 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 Cheng | e403290 | 2019-12-19 12:38:08 +0800 | [diff] [blame] | 100 | developmentOnly("org.springframework.boot:spring-boot-devtools") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 101 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 102 | implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 103 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 104 | 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}" |
qiaowei | 38b4616 | 2019-09-09 16:35:58 +0800 | [diff] [blame] | 107 | |
Tang Cheng | 62d405b | 2019-12-24 15:39:45 +0800 | [diff] [blame] | 108 | implementation "com.supwisdom:multi-tenant-core:${multiTenantLibVersion}" |
| 109 | implementation "com.supwisdom:multi-tenant-datasource:${multiTenantLibVersion}" |
Tang Cheng | 11be1ac | 2020-01-10 15:31:25 +0800 | [diff] [blame] | 110 | implementation "com.supwisdom:multi-tenant-jwt:${multiTenantLibVersion}" |
Tang Cheng | 7b61058 | 2020-02-18 21:28:33 +0800 | [diff] [blame] | 111 | implementation "com.supwisdom:multi-tenant-task:${multiTenantLibVersion}" |
Tang Cheng | 62d405b | 2019-12-24 15:39:45 +0800 | [diff] [blame] | 112 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 113 | implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}" |
| 114 | implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar") |
| 115 | implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}" |
qiaowei | 1657eef | 2019-07-22 17:50:33 +0800 | [diff] [blame] | 116 | /*支付宝SDK*/ |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 117 | implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 118 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 119 | implementation "com.github.penggle:kaptcha:${kaptchaVersion}" |
| 120 | implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 121 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 122 | } |
| 123 | |