feat: 修改了 build.gradle 增加了 spring cloud 配置
diff --git a/payapi/build.gradle b/payapi/build.gradle
index 33dc6c1..76f80e3 100644
--- a/payapi/build.gradle
+++ b/payapi/build.gradle
@@ -3,6 +3,7 @@
plugins {
id 'java'
id 'org.springframework.boot'
+ id 'io.spring.dependency-management'
id 'org.jetbrains.kotlin.jvm'
id 'org.jetbrains.kotlin.plugin.jpa' version '1.3.31'
id 'org.jetbrains.kotlin.plugin.spring'
@@ -10,9 +11,6 @@
id 'com.palantir.docker'
}
-apply plugin: 'java'
-apply plugin: 'io.spring.dependency-management'
-
payapiVersion = gitVersion()
def details = versionDetails()
@@ -26,7 +24,8 @@
bootJar {
mainClassName = payapiStartClass
manifest {
- attributes('Payapi-Version': payapiVersion,'Payapi-Buildtime':new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date()))
+ attributes('Payapi-Version': payapiVersion,
+ 'Payapi-Buildtime': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date()))
}
}
@@ -34,6 +33,10 @@
baseName = 'payapi'
}
+ext {
+ set('springCloudVersion', "Greenwich.SR2")
+}
+
docker {
def imageVersion
if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) {
@@ -65,6 +68,7 @@
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.springframework.social:spring-social-web:1.1.6.RELEASE'
+ implementation 'org.springframework.kafka:spring-kafka:2.2.8.RELEASE'
implementation 'org.jetbrains.kotlin:kotlin-reflect'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'commons-codec:commons-codec:1.12'
@@ -72,10 +76,12 @@
implementation 'net.javacrumbs.shedlock:shedlock-spring:2.5.0'
implementation 'net.javacrumbs.shedlock:shedlock-provider-redis-spring:2.5.0'
- implementation 'org.springframework.cloud:spring-cloud-starter-consul-discovery:2.1.2.RELEASE'
+ implementation 'org.springframework.cloud:spring-cloud-starter'
+ implementation 'org.springframework.cloud:spring-cloud-starter-consul-discovery'
+ implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix'
+ implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
- implementation 'org.springframework.kafka:spring-kafka:2.2.8.RELEASE'
runtime("org.springframework.boot:spring-boot-devtools")
implementation 'org.postgresql:postgresql:42.2.5'
@@ -113,6 +119,12 @@
testImplementation 'org.hamcrest:hamcrest:2.1'
}
+dependencyManagement {
+ imports {
+ mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
+ }
+}
+
compileKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xjsr305=strict']