Update: T03/搭建config-server模块

This commit is contained in:
2025-10-06 18:39:33 +08:00
parent 0932eecaf1
commit 577e4d4462
4 changed files with 64 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.hezhaohui</groupId>
<artifactId>spring-cloud-template</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>config-server</artifactId>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-eureka-client</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,15 @@
package cn.hezhaohui.configserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.config.server.EnableConfigServer;
@SpringBootApplication
@EnableConfigServer
@EnableDiscoveryClient
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class, args);
}
}
@@ -0,0 +1,16 @@
server:
port: 8888
spring:
application:
name: config-server
cloud:
config:
server:
git:
uri: xxxxx
search-paths: config-files
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
+1
View File
@@ -12,6 +12,7 @@
<modules>
<module>eureka-server</module>
<module>config-server</module>
</modules>
<properties>