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 | |
| 17 | bootJar { |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 18 | enabled = true |
Tang Cheng | 8beabcd | 2019-07-12 11:48:01 +0800 | [diff] [blame] | 19 | mainClassName = payapiStartClass |
Tang Cheng | 307ec57 | 2019-12-25 10:03:05 +0800 | [diff] [blame] | 20 | def standalone = "" |
| 21 | if (rootProject.hasProperty("no-multi-tenant")) { |
| 22 | standalone = "-stangalone-" |
| 23 | } |
| 24 | archiveFileName = "${project.name}${standalone}-${buildVersion}.${archiveExtension.getOrElse('.jar')}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 25 | manifest { |
Tang Cheng | f36d725 | 2019-12-17 14:14:50 +0800 | [diff] [blame] | 26 | attributes("Payapi-Version": buildVersion, |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 27 | "Payapi-Buildtime": buildTime) |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 28 | } |
| 29 | } |
| 30 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 31 | compileKotlin { |
| 32 | kotlinOptions { |
| 33 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 34 | jvmTarget = jdkVersion |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | compileTestKotlin { |
| 39 | kotlinOptions { |
| 40 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 41 | jvmTarget = jdkVersion |
| 42 | } |
Tang Cheng | 468da54 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 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 | 910ebfa | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 47 | if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 48 | imageVersion = "dev" |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 49 | } else { |
| 50 | imageVersion = details.lastTag |
| 51 | } |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 52 | println("Docker image tag : ${imageVersion}") |
| 53 | name "${dockerRegistry}/payapi:${imageVersion}" |
| 54 | println(jar.archiveFile.get()) |
| 55 | files jar.archiveFile.get() |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | docker.dependsOn(jar) |
| 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}" |
| 110 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 111 | 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}" |
qiaowei | 1657eef | 2019-07-22 17:50:33 +0800 | [diff] [blame] | 114 | /*支付宝SDK*/ |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 115 | implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 116 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 117 | implementation "com.github.penggle:kaptcha:${kaptchaVersion}" |
| 118 | implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 119 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 120 | } |
| 121 | |