refactor: 合并 bootstrap.yml 到 application.yml

- 将 Nacos 配置改为环境变量形式(更灵活)
- 添加 config.enabled: false 配置
- 删除 bootstrap.yml 文件
- 更新 assembly.xml 移除 bootstrap.yml 引用
This commit is contained in:
zhangjf 2026-02-24 18:37:34 +08:00
parent 55eb8badc7
commit abe485a267
3 changed files with 12 additions and 27 deletions

View File

@ -58,7 +58,6 @@
<outputDirectory>conf</outputDirectory> <outputDirectory>conf</outputDirectory>
<includes> <includes>
<include>application.yml</include> <include>application.yml</include>
<include>bootstrap.yml</include>
<include>logback-spring.xml</include> <include>logback-spring.xml</include>
<include>service.properties</include> <include>service.properties</include>
</includes> </includes>

View File

@ -41,18 +41,20 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: localhost:8848 server-addr: ${NACOS_SERVER_ADDR:localhost:8848}
username: nacos username: ${NACOS_USERNAME:nacos}
password: nacos password: ${NACOS_PASSWORD:nacos}
namespace: worklog-dev namespace: ${NACOS_NAMESPACE:worklog-dev}
group: DEFAULT_GROUP group: ${NACOS_GROUP:DEFAULT_GROUP}
config: config:
server-addr: localhost:8848 server-addr: ${NACOS_SERVER_ADDR:localhost:8848}
username: nacos username: ${NACOS_USERNAME:nacos}
password: nacos password: ${NACOS_PASSWORD:nacos}
namespace: worklog-dev namespace: ${NACOS_NAMESPACE:worklog-dev}
file-extension: yml file-extension: yml
group: DEFAULT_GROUP group: ${NACOS_GROUP:DEFAULT_GROUP}
# 是否启用 Nacos 配置中心(默认不启用)
enabled: false
server: server:
port: 8200 port: 8200

View File

@ -1,16 +0,0 @@
spring:
application:
name: worklog-api
# Nacos 配置中心(可选,如果使用配置中心)
cloud:
nacos:
config:
server-addr: ${NACOS_SERVER_ADDR:localhost:8848}
namespace: ${NACOS_NAMESPACE:worklog-dev}
group: ${NACOS_GROUP:DEFAULT_GROUP}
username: ${NACOS_USERNAME:nacos}
password: ${NACOS_PASSWORD:nacos}
file-extension: yml
# 是否启用 Nacos 配置中心(默认不启用)
enabled: false