【发布时间】:2018-05-03 11:09:04
【问题描述】:
我需要使用两个*.properties 文件来确定Spring Boot 应用服务器的配置。如何设置第二个配置路径?
我使用spring-boot-starter-parent版本1.5.10等*.properties文件:
spring.datasource.url=url
spring.datasource.username=root
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialec
spring.jpa.properties.hibernate.current_session_context_class=
org.springframewok.orm.hibernate4.SpringSessionContext
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.idle-timeout=30000
现在,我需要从另一个属性文件中处理数据库信息。
编辑:请注意,我需要将第二个属性文件放在我的 WAR 文件之外的 WEB-INF 文件夹中。
【问题讨论】:
标签: java spring spring-boot properties-file