From 74cd7fc3d0a7fa1d5c84007dc89b669c2bd3062f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=8C=BFDD?= Date: Sat, 25 Jun 2016 22:32:30 +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=89=EF=BC=89?= =?UTF-8?q?=E6=96=AD=E8=B7=AF=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chapter9-1-3/eureka-server/pom.xml | 62 +++++++++++++++++++ .../main/java/com/didispace/Application.java | 15 +++++ .../src/main/resources/application.properties | 6 ++ 3 files changed, 83 insertions(+) create mode 100644 Chapter9-1-3/eureka-server/pom.xml create mode 100644 Chapter9-1-3/eureka-server/src/main/java/com/didispace/Application.java create mode 100644 Chapter9-1-3/eureka-server/src/main/resources/application.properties diff --git a/Chapter9-1-3/eureka-server/pom.xml b/Chapter9-1-3/eureka-server/pom.xml new file mode 100644 index 0000000..3f01c31 --- /dev/null +++ b/Chapter9-1-3/eureka-server/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.didispace + eureka-server + 1.0.0 + jar + + eureka-server + Spring Cloud project + + + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + + + + + UTF-8 + 1.8 + + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.cloud + spring-cloud-starter-eureka-server + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + Brixton.RELEASE + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/Chapter9-1-3/eureka-server/src/main/java/com/didispace/Application.java b/Chapter9-1-3/eureka-server/src/main/java/com/didispace/Application.java new file mode 100644 index 0000000..414607d --- /dev/null +++ b/Chapter9-1-3/eureka-server/src/main/java/com/didispace/Application.java @@ -0,0 +1,15 @@ +package com.didispace; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; + +@EnableEurekaServer +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + new SpringApplicationBuilder(Application.class).web(true).run(args); + } + +} diff --git a/Chapter9-1-3/eureka-server/src/main/resources/application.properties b/Chapter9-1-3/eureka-server/src/main/resources/application.properties new file mode 100644 index 0000000..8dad723 --- /dev/null +++ b/Chapter9-1-3/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 +eureka.client.serviceUrl.defaultZone=http://localhost:${server.port}/eureka/ \ No newline at end of file