update yml config

This commit is contained in:
thinkgem
2024-12-24 00:14:22 +08:00
parent f4d3b2016e
commit fa1107737a
4 changed files with 19 additions and 18 deletions

View File

@@ -36,9 +36,7 @@ public class PropertiesUtils {
// 默认加载的文件可通过继承覆盖若有相同Key优先加载后面的 // 默认加载的文件可通过继承覆盖若有相同Key优先加载后面的
public static final String[] DEFAULT_CONFIG_FILE = new String[]{ public static final String[] DEFAULT_CONFIG_FILE = new String[]{
"classpath:application.yml", "classpath:config/application.yml", "classpath:application.yml", "classpath:config/application.yml",
"classpath:bootstrap.yml", "classpath:config/bootstrap.yml",
"file:application.yml", "file:config/application.yml", "file:application.yml", "file:config/application.yml",
"file:bootstrap.yml", "file:config/bootstrap.yml",
}; };
private static final Logger logger = PropertiesUtils.initLogger(); private static final Logger logger = PropertiesUtils.initLogger();

View File

@@ -60,14 +60,14 @@ spring:
# 服务注册和配置 # 服务注册和配置
nacos: nacos:
server-addr: 192.168.56.1:8848
username: nacos
password: nacos
discovery: discovery:
server-addr: 192.168.56.1:8848 namespace: ~
group: jeesite-cloud
config: config:
server-addr: 192.168.56.1:8848 namespace: ~
file-extension: yml
group: jeesite-cloud-yml
extension-configs:
- data-id: application.yml
group: jeesite-cloud-yml group: jeesite-cloud-yml
# 服务发现与注册优选IP前缀 # 服务发现与注册优选IP前缀

View File

@@ -48,6 +48,16 @@ spring:
profiles: profiles:
active: default active: default
# 加载的配置文件
config:
# import:
# - 'optional:configserver:'
import:
- 'nacos:application.yml'
- 'nacos:application-${spring.profiles.active}.yml'
- 'nacos:${spring.application.name}.yml'
- 'nacos:${spring.application.name}-${spring.profiles.active}.yml'
# 分布式配置中心 # 分布式配置中心
cloud: cloud:
config: config:
@@ -65,21 +75,14 @@ spring:
# 服务注册和配置 # 服务注册和配置
nacos: nacos:
discovery:
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
username: nacos username: nacos
password: nacos password: nacos
discovery:
namespace: ~ namespace: ~
group: jeesite-cloud group: jeesite-cloud
config: config:
server-addr: 127.0.0.1:8848
username: nacos
password: nacos
namespace: ~ namespace: ~
file-extension: yml
group: jeesite-cloud-yml
extension-configs:
- data-id: application.yml
group: jeesite-cloud-yml group: jeesite-cloud-yml
# 服务发现与注册优选IP前缀 # 服务发现与注册优选IP前缀