From 469798e649507c73d517bbe64dc13e0932934b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=8C=BFDD?= Date: Tue, 31 May 2016 21:38:15 +0800 Subject: [PATCH] =?UTF-8?q?Spring=20Cloud=E6=9E=84=E5=BB=BA=E5=BE=AE?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=9E=B6=E6=9E=84=EF=BC=88=E4=B8=80=EF=BC=89?= =?UTF-8?q?=E2=80=94=E2=80=94=E6=9C=8D=E5=8A=A1=E6=B3=A8=E5=86=8C=E4=B8=8E?= =?UTF-8?q?=E5=8F=91=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chapter9-1-1/eureka-server/pom.xml | 24 +++++++++++++++---- .../main/java/com/didispace/Application.java | 2 +- .../src/main/resources/application.properties | 6 +++++ .../src/main/resources/application.yml | 12 ---------- 4 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 Chapter9-1-1/eureka-server/src/main/resources/application.properties delete mode 100755 Chapter9-1-1/eureka-server/src/main/resources/application.yml diff --git a/Chapter9-1-1/eureka-server/pom.xml b/Chapter9-1-1/eureka-server/pom.xml index 770fb70..3f01c31 100644 --- a/Chapter9-1-1/eureka-server/pom.xml +++ b/Chapter9-1-1/eureka-server/pom.xml @@ -12,9 +12,10 @@ Spring Cloud project - org.springframework.cloud - spring-cloud-starter-parent - 1.0.0.RELEASE + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + @@ -25,8 +26,9 @@ - org.springframework.cloud - spring-cloud-starter + org.springframework.boot + spring-boot-starter-test + test @@ -35,6 +37,18 @@ + + + + + org.springframework.cloud + spring-cloud-dependencies + Brixton.RELEASE + pom + import + + + diff --git a/Chapter9-1-1/eureka-server/src/main/java/com/didispace/Application.java b/Chapter9-1-1/eureka-server/src/main/java/com/didispace/Application.java index 27e47f5..d3133f6 100755 --- a/Chapter9-1-1/eureka-server/src/main/java/com/didispace/Application.java +++ b/Chapter9-1-1/eureka-server/src/main/java/com/didispace/Application.java @@ -4,8 +4,8 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; -@SpringBootApplication @EnableEurekaServer +@SpringBootApplication public class Application { public static void main(String[] args) { diff --git a/Chapter9-1-1/eureka-server/src/main/resources/application.properties b/Chapter9-1-1/eureka-server/src/main/resources/application.properties new file mode 100644 index 0000000..0f784a1 --- /dev/null +++ b/Chapter9-1-1/eureka-server/src/main/resources/application.properties @@ -0,0 +1,6 @@ +server.port=1111 + +#eureka.instance.hostname=localhost + +eureka.client.register-with-eureka=false +eureka.client.fetch-registry=false \ No newline at end of file diff --git a/Chapter9-1-1/eureka-server/src/main/resources/application.yml b/Chapter9-1-1/eureka-server/src/main/resources/application.yml deleted file mode 100755 index 75c344e..0000000 --- a/Chapter9-1-1/eureka-server/src/main/resources/application.yml +++ /dev/null @@ -1,12 +0,0 @@ -# 配置应用服务器(Tomcat) -server: - port: 1111 # HTTP端口 - -# 配置发现服务器(Discovery Server) -eureka: - instance: - hostname: localhost - client: # 不是客户端,所以不注册自己 - registerWithEureka: false - fetchRegistry: false -