【发布时间】:2015-07-22 11:09:14
【问题描述】:
各位,您知道是否可以从 maven 依赖项中获取属性文件?更准确地说,我使用的是 Spring 4,我的 application.properties 看起来像这样:
logging.level.org.springframework.web: INFO
logging.level.org.hibernate: ERROR
logging.level.com.example.movies: DEBUG
spring.config.location=example-backend-development-domain/src/main/resources/application.properties
最后一行不起作用。但是我想要指定这个 application.properties 文件位于 maven 依赖项内的资源文件夹内(顺便说一下,它与这个实际项目的父级相同)。 所以,这就是依赖:
<dependency>
<groupId>com.despegar.qc.example</groupId>
<artifactId>example-backend-development-domain</artifactId>
</dependency>
你知道这是否可能使 spring.config.location 行工作?在那种情况下,你知道该怎么做吗?提前致谢!
【问题讨论】:
标签: java spring maven configuration dependency-properties