diff --git a/pom.xml b/pom.xml
index 209f5084dd499f9383ecab5e240964f3c70342a0..54bb1b49aec2bcd9e17df6a4bfd40e7a0592a943 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,6 +28,7 @@
springcloud-service-goods
springcloud-service-common
springcloud-service-portal
+ springcloud-service-eureka
diff --git a/springcloud-service-eureka/pom.xml b/springcloud-service-eureka/pom.xml
index d3fa68e99c83b7ea9c8678fa787e3c70773cfa45..c00bcd3cbc8542fb9fe6f009df0b24b8ccda8553 100644
--- a/springcloud-service-eureka/pom.xml
+++ b/springcloud-service-eureka/pom.xml
@@ -12,7 +12,7 @@
springcloud-service-eureka
1.8
- 2022.0.0
+ Hoxton.SR12
@@ -30,7 +30,7 @@
test
-
+
@@ -51,15 +51,15 @@
-
-
- netflix-candidates
- Netflix Candidates
- https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/springcloud-service-eureka/src/main/java/com/kwan/springcloud/EurekaApplication.java b/springcloud-service-eureka/src/main/java/com/kwan/springcloud/EurekaApplication.java
index b9f3afb1d9d995264f15086c4caebd17b70bc894..55d1741c4097aa54be43ee8b75c1ce2647142f8c 100644
--- a/springcloud-service-eureka/src/main/java/com/kwan/springcloud/EurekaApplication.java
+++ b/springcloud-service-eureka/src/main/java/com/kwan/springcloud/EurekaApplication.java
@@ -3,16 +3,10 @@ package com.kwan.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+@EnableEurekaServer
@SpringBootApplication
-public class SpringcloudServiceEurekaApplication {
-
+public class EurekaApplication {
public static void main(String[] args) {
- SpringApplication.run(SpringcloudServiceEurekaApplication.class, args);
+ SpringApplication.run(EurekaApplication.class, args);
}
-
-}
-
-
-
-
-
+}
\ No newline at end of file
diff --git a/springcloud-service-eureka/src/main/resources/application.yaml b/springcloud-service-eureka/src/main/resources/application.yaml
index 3beb6a15d8c156c93391630d98c1f6c794d093bb..872465fa2c27f99895b44bb5930abdce5c05b2da 100644
--- a/springcloud-service-eureka/src/main/resources/application.yaml
+++ b/springcloud-service-eureka/src/main/resources/application.yaml
@@ -2,5 +2,15 @@
server:
port: 8761
+spring:
+ application:
+ name: eurka-server
-eureka
\ No newline at end of file
+eureka:
+ instance:
+ hostname: localhost
+ client:
+ register-with-eureka: false #由于该应用为注册中心,所以设置 为 false, 代表不向注册中心注册自己。
+ fetch-registry: false #由于注册中心的职责就是维护服务实例, 它并不需要去检索服务, 所以也设置为 false。
+ serviceUrl:
+ defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
\ No newline at end of file
diff --git a/springcloud-service-eureka/src/test/java/com/kwan/springcloud/EurekaApplicationTests.java b/springcloud-service-eureka/src/test/java/com/kwan/springcloud/EurekaApplicationTests.java
index 3fc8b85a01a9c86ffcf38a83233f299b708e6d17..aeaa32274d8c3050acb43ebab32a42ac580a3edd 100644
--- a/springcloud-service-eureka/src/test/java/com/kwan/springcloud/EurekaApplicationTests.java
+++ b/springcloud-service-eureka/src/test/java/com/kwan/springcloud/EurekaApplicationTests.java
@@ -4,7 +4,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
-class SpringcloudServiceEurekaApplicationTests {
+public class EurekaApplicationTests {
@Test
void contextLoads() {
diff --git a/springcloud-service-goods/pom.xml b/springcloud-service-goods/pom.xml
index a3f38e62173b1599db5271e32486f1c174df1def..e990e7a7644289d6353db1a0dfe51d3b9a4b9286 100644
--- a/springcloud-service-goods/pom.xml
+++ b/springcloud-service-goods/pom.xml
@@ -10,6 +10,12 @@
springcloud-service-goods
0.0.1-SNAPSHOT
springcloud-service-goods
+
+ UTF-8
+ UTF-8
+ 1.8
+ Hoxton.SR12
+
com.kwan.springcloud