Skip to content

Commit 74cd7fc

Browse files
dyc87112zhaiyongchao
authored and
zhaiyongchao
committed
Spring Cloud构建微服务架构(三)断路器
1 parent 13dcebb commit 74cd7fc

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

Chapter9-1-3/eureka-server/pom.xml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.didispace</groupId>
7+
<artifactId>eureka-server</artifactId>
8+
<version>1.0.0</version>
9+
<packaging>jar</packaging>
10+
11+
<name>eureka-server</name>
12+
<description>Spring Cloud project</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.3.5.RELEASE</version>
18+
<relativePath/> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<java.version>1.8</java.version>
24+
</properties>
25+
26+
<dependencies>
27+
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-test</artifactId>
31+
<scope>test</scope>
32+
</dependency>
33+
34+
<dependency>
35+
<groupId>org.springframework.cloud</groupId>
36+
<artifactId>spring-cloud-starter-eureka-server</artifactId>
37+
</dependency>
38+
39+
</dependencies>
40+
41+
<dependencyManagement>
42+
<dependencies>
43+
<dependency>
44+
<groupId>org.springframework.cloud</groupId>
45+
<artifactId>spring-cloud-dependencies</artifactId>
46+
<version>Brixton.RELEASE</version>
47+
<type>pom</type>
48+
<scope>import</scope>
49+
</dependency>
50+
</dependencies>
51+
</dependencyManagement>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-maven-plugin</artifactId>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
62+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.didispace;
2+
3+
import org.springframework.boot.autoconfigure.SpringBootApplication;
4+
import org.springframework.boot.builder.SpringApplicationBuilder;
5+
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6+
7+
@EnableEurekaServer
8+
@SpringBootApplication
9+
public class Application {
10+
11+
public static void main(String[] args) {
12+
new SpringApplicationBuilder(Application.class).web(true).run(args);
13+
}
14+
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
server.port=1111
2+
#eureka.instance.hostname=localhost
3+
4+
eureka.client.register-with-eureka=false
5+
eureka.client.fetch-registry=false
6+
eureka.client.serviceUrl.defaultZone=http://localhost:${server.port}/eureka/

0 commit comments

Comments
 (0)