【发布时间】:2012-11-21 10:27:29
【问题描述】:
我有以下资源文件的 spring 配置,当我在 eclipse 环境中执行时它工作得很好。但是当我将应用程序打包成 JAR 并执行时,它不会归档属性文件资源。
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="locations">
<list>
<value>classpath:Application.properties</value>
<value>classpath:database.properties</value>
</list>
</property>
</bean>
<!-- define the properties file to use -->
<util:properties id="appProperties" location="classpath:Application.properties" />
当我看到 jar 文件时,所有文件都存在。我正在使用 maven 构建程序集。
项目结构:
项目名称 | |--主要 |-- 爪哇 |-- 资源
另外,我正在使用此链接 (http://stackoverflow.com/questions/13615634/maven-build-assembly-with-dependencies) 使用 maven 配置
【问题讨论】:
-
您遇到异常了吗?你能添加堆栈跟踪吗?