【发布时间】:2013-06-17 16:03:38
【问题描述】:
我的詹金斯作业复制属性文件(秘密插件)如下
if [[ ! -d ~/.app ]]
then
mkdir ~/.app
fi
cp ${SECRET}/app.properties ~/.app/app.properties
这似乎可行,因为我确实得到了
- cp /scratch/jenkins/secrets/d97a8ac1-8edc-4b15-b328-dc777d1b13c9/app.properties /home/jenkins/.app/app.properties
而我部署的war有如下配置
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:///home/jenkins/.app/app.properties"/>
</bean>
<bean id="facebookConfig" class="com.dk.integration.fb.service.FacebookConfig">
<property name="applicationSecret" value="${app.secret}"></property>
<property name="applicationKey" value="${app.key}"></property>
<property name="applicationRedirectURI" value="${app.redirecturi}"></property>
</bean>
app.properties
app.secret=...
app.key=....
app.redirecturi=http://.....
但是,我仍然得到 无法在 org.springframework.beans.factory.config.PlaceholderConfigurerSupport 解析占位符“app.secret” .doProcessProperties(PlaceholderConfigurerSupport.java:209)
我没有多个 PropertyPlaceholderConfigurer。任何帮助将不胜感激。
【问题讨论】: