application.properties文件
spring.profiles.active=prod
application-prod.properties文件
nacos.config.server-addr=192.168.99.10:8848
nacos.config.namespace=5016085c-9861-447f-bb57-21d5562752fa
#nacos.config.ext-config[0].data-id=nacos.log
nacos.config.ext-config[0].group=HRMIS
nacos.config.ext-config[0].max-retry=10
nacos.config.ext-config[0].type=text,xml,yaml,properties
nacos.config.ext-config[0].auto-refresh=true
nacos.config.ext-config[0].config-retry-time=2333
nacos.config.ext-config[0].config-long-poll-timeout=46000
nacos.config.ext-config[0].enable-remote-sync-config=true
@NacosPropertySource(dataId = "application.properties", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "app.uconfig-policy.xml", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "app.web.properties", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "caffeine.properties", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@NacosPropertySource(dataId = "logback-spring.xml", groupId = "HRMIS", autoRefreshed = true, first = true, before = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, after = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME)
@EnableEncryptableProperties
public class HrmisApplication {
public static void main(String[] args) {
SpringApplication.run(HrmisApplication.class, args);
}
}
先建命名空间,然后建配置列表
建配置列表时记得先选择命名空间