Skip to content

Commit f4ba498

Browse files
committed
微服务完善
1 parent fc2047a commit f4ba498

File tree

6 files changed

+80
-47
lines changed

6 files changed

+80
-47
lines changed

hello-service-api/pom.xml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,27 @@
77
<artifactId>hello-service-api</artifactId>
88
<version>1.0-SNAPSHOT</version>
99
<groupId>com.microservice.hello</groupId>
10-
10+
<parent>
11+
<artifactId>micro-service</artifactId>
12+
<groupId>spring.cloud</groupId>
13+
<version>1.0-SNAPSHOT</version>
14+
</parent>
1115
<dependencies>
1216
<dependency>
13-
<groupId>org.springframework</groupId>
14-
<artifactId>spring-web</artifactId>
15-
<version>4.2.9.RELEASE</version>
17+
<groupId>org.springframework.boot</groupId>
18+
<artifactId>spring-boot-starter-web</artifactId>
1619
</dependency>
1720
</dependencies>
18-
21+
<build>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<configuration>
27+
<source>1.8</source>
28+
<target>1.8</target>
29+
</configuration>
30+
</plugin>
31+
</plugins>
32+
</build>
1933
</project>

hello-service-consumer/pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@
4646
<groupId>org.springframework.boot</groupId>
4747
<artifactId>spring-boot-starter-actuator</artifactId>
4848
</dependency>
49-
5049
</dependencies>
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-compiler-plugin</artifactId>
55+
<configuration>
56+
<source>1.8</source>
57+
<target>1.8</target>
58+
</configuration>
59+
</plugin>
60+
</plugins>
61+
</build>
5162
</project>

hello-service-provider/pom.xml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,47 +22,55 @@
2222
<artifactId>hello-service-api</artifactId>
2323
<version>1.0-SNAPSHOT</version>
2424
</dependency>
25-
25+
<!--web工程包-->
2626
<dependency>
2727
<groupId>org.springframework.boot</groupId>
2828
<artifactId>spring-boot-starter-web</artifactId>
2929
</dependency>
30-
30+
<!--服务注册和发现包-->
3131
<dependency>
3232
<groupId>org.springframework.cloud</groupId>
3333
<artifactId>spring-cloud-starter-eureka</artifactId>
3434
</dependency>
35-
35+
<!--服务调用负载均衡包-->
3636
<dependency>
3737
<groupId>org.springframework.cloud</groupId>
3838
<artifactId>spring-cloud-starter-ribbon</artifactId>
3939
</dependency>
40-
40+
<!--工程元信息检测包-->
4141
<dependency>
42-
<groupId>org.springframework.cloud</groupId>
43-
<artifactId>spring-cloud-starter-hystrix</artifactId>
42+
<groupId>org.springframework.boot</groupId>
43+
<artifactId>spring-boot-starter-actuator</artifactId>
4444
</dependency>
4545

46-
<dependency>
46+
<!--<dependency>
4747
<groupId>org.springframework.cloud</groupId>
48-
<artifactId>spring-cloud-starter-sleuth</artifactId>
49-
</dependency>
50-
48+
<artifactId>spring-cloud-starter-hystrix</artifactId>
49+
</dependency>-->
5150

52-
<dependency>
51+
<!--<dependency>
5352
<groupId>org.springframework.cloud</groupId>
54-
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
55-
</dependency>
56-
57-
<dependency>
58-
<groupId>org.springframework.boot</groupId>
59-
<artifactId>spring-boot-starter-actuator</artifactId>
60-
</dependency>
61-
62-
<dependency>
53+
<artifactId>spring-cloud-starter-sleuth</artifactId>
54+
</dependency>-->
55+
<!--<dependency>-->
56+
<!--<groupId>org.springframework.cloud</groupId>-->
57+
<!--<artifactId>spring-cloud-sleuth-zipkin</artifactId>-->
58+
<!--</dependency>-->
59+
<!--<dependency>
6360
<groupId>org.springframework.boot</groupId>
6461
<artifactId>spring-boot-starter-amqp</artifactId>
65-
</dependency>
66-
62+
</dependency>-->
6763
</dependencies>
64+
<build>
65+
<plugins>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-compiler-plugin</artifactId>
69+
<configuration>
70+
<source>1.8</source>
71+
<target>1.8</target>
72+
</configuration>
73+
</plugin>
74+
</plugins>
75+
</build>
6876
</project>

hello-service-provider/src/main/java/com/microservice/remote/HelloProviderApplication.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5-
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
65
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
76

87
/**
@@ -13,7 +12,6 @@
1312
* @param
1413
* @return
1514
*/
16-
@EnableCircuitBreaker
1715
@EnableDiscoveryClient
1816
@SpringBootApplication
1917
public class HelloProviderApplication {

pom.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,36 @@
2121
<parent>
2222
<groupId>org.springframework.boot</groupId>
2323
<artifactId>spring-boot-starter-parent</artifactId>
24-
<version>1.5.10.RELEASE</version>
24+
<version>1.5.2.RELEASE</version>
2525
</parent>
2626

2727
<dependencyManagement>
2828
<dependencies>
2929
<dependency>
3030
<groupId>org.springframework.cloud</groupId>
3131
<artifactId>spring-cloud-dependencies</artifactId>
32-
<version>Edgware.SR3</version>
32+
<version>Dalston.RELEASE</version>
3333
<type>pom</type>
3434
<scope>import</scope>
3535
</dependency>
3636
<dependency>
3737
<groupId>org.springframework.boot</groupId>
3838
<artifactId>spring-boot-starter-test</artifactId>
39-
<version>1.5.10.RELEASE</version>
39+
<version>1.5.2.RELEASE</version>
4040
<scope>test</scope>
4141
</dependency>
4242
</dependencies>
4343
</dependencyManagement>
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.apache.maven.plugins</groupId>
48+
<artifactId>maven-compiler-plugin</artifactId>
49+
<configuration>
50+
<source>1.8</source>
51+
<target>1.8</target>
52+
</configuration>
53+
</plugin>
54+
</plugins>
55+
</build>
4456
</project>

registration-center/pom.xml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,15 @@
1313
<packaging>jar</packaging>
1414

1515
<name>registration-center</name>
16-
<dependencyManagement>
17-
<dependencies>
18-
<dependency>
19-
<groupId>org.springframework.cloud</groupId>
20-
<artifactId>spring-cloud-dependencies</artifactId>
21-
<version>Edgware.SR3</version>
22-
<type>pom</type>
23-
<scope>import</scope>
24-
</dependency>
25-
</dependencies>
26-
</dependencyManagement>
2716
<dependencies>
2817
<dependency>
2918
<groupId>org.springframework.cloud</groupId>
30-
<artifactId>spring-cloud-starter-config</artifactId>
19+
<artifactId>spring-cloud-starter-eureka-server</artifactId>
3120
</dependency>
3221
<dependency>
33-
<groupId>org.springframework.cloud</groupId>
34-
<artifactId>spring-cloud-starter-eureka-server</artifactId>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-starter-test</artifactId>
24+
<scope>test</scope>
3525
</dependency>
3626
</dependencies>
3727
</project>

0 commit comments

Comments
 (0)