Browse Source

添加spring boot admin client依赖

tuonina 6 years ago
parent
commit
26aa42275c

+ 6 - 0
build.gradle

@@ -53,6 +53,11 @@ subprojects {
     [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
     compileJava.dependsOn(processResources)
 
+    ext{
+        set('springBootAdminVersion', '2.1.4')
+    }
+
+
     repositories {
         maven { url 'https://maven.aliyun.com/repository/public' }
         mavenCentral()
@@ -99,6 +104,7 @@ subprojects {
         compile('org.springframework.boot:spring-boot-starter-web')
         compile('org.springframework.boot:spring-boot-starter-jdbc')
         compile('org.springframework.boot:spring-boot-starter-actuator')
+        compile("de.codecentric:spring-boot-admin-starter-client:${springBootAdminVersion}")
 
         compile('org.springframework.boot:spring-boot-starter-jta-atomikos')
         compile('org.springframework.boot:spring-boot-starter-jetty')

+ 1 - 1
zen-web/src/main/kotlin/cn/gygxzc/envir/MainApplication.kt

@@ -11,6 +11,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient
 import org.springframework.cloud.openfeign.EnableFeignClients
+import org.springframework.web.servlet.DispatcherServlet
 
 /**
  * 注解配置
@@ -31,6 +32,5 @@ class MainApplication : SpringBootServletInitializer() {
 }
 
 fun main(args: Array<String>) {
-
     SpringApplication.run(MainApplication::class.java, *args)
 }

+ 9 - 0
zen-web/src/main/resources/application.yml

@@ -6,3 +6,12 @@ spring:
 swagger:
   open: true
 
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+
+
+logging:
+  path: .logs

+ 1 - 1
zen-web/src/main/resources/bootstrap.yml

@@ -15,7 +15,7 @@ spring:
       profile: ${spring.profiles.active}
       discovery:
         enabled: true
-        service-id: registry
+        service-id: config
       allow-override: true
       username: envir
       password: envir