diff --git a/config-server/pom.xml b/config-server/pom.xml new file mode 100644 index 0000000..e9e200e --- /dev/null +++ b/config-server/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + cn.hezhaohui + spring-cloud-template + 1.0-SNAPSHOT + + + config-server + + + 21 + 21 + UTF-8 + + + + + org.springframework.cloud + spring-cloud-config-server + + + + org.springframework.cloud + spring-cloud-netflix-eureka-client + + + + \ No newline at end of file diff --git a/config-server/src/main/java/cn/hezhaohui/configserver/ConfigServerApplication.java b/config-server/src/main/java/cn/hezhaohui/configserver/ConfigServerApplication.java new file mode 100644 index 0000000..5ef3304 --- /dev/null +++ b/config-server/src/main/java/cn/hezhaohui/configserver/ConfigServerApplication.java @@ -0,0 +1,15 @@ +package cn.hezhaohui.configserver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.config.server.EnableConfigServer; + +@SpringBootApplication +@EnableConfigServer +@EnableDiscoveryClient +public class ConfigServerApplication { + public static void main(String[] args) { + SpringApplication.run(ConfigServerApplication.class, args); + } +} diff --git a/config-server/src/main/resources/application.yml b/config-server/src/main/resources/application.yml new file mode 100644 index 0000000..9e34d24 --- /dev/null +++ b/config-server/src/main/resources/application.yml @@ -0,0 +1,16 @@ +server: + port: 8888 +spring: + application: + name: config-server + cloud: + config: + server: + git: + uri: xxxxx + search-paths: config-files + +eureka: + client: + service-url: + defaultZone: http://localhost:8761/eureka/ \ No newline at end of file diff --git a/pom.xml b/pom.xml index b517d1b..30f52f7 100644 --- a/pom.xml +++ b/pom.xml @@ -12,6 +12,7 @@ eureka-server + config-server