【问题标题】:Spring PropertyPlaceholderConfigurer on Cloudbees cannot resolve propertyCloudbees 上的 Spring PropertyPlaceholderConfigurer 无法解析属性
【发布时间】: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。任何帮助将不胜感激。

【问题讨论】:

    标签: spring jenkins cloudbees


    【解决方案1】:

    DEV@Cloud 构建从属节点和 RUN@Cloud 服务器节点是不同的主机。您的 jenkins 作业不能用于准备运行时环境。要注入这样的配置,请使用configuration parameters

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-06
      • 2023-04-10
      • 1970-01-01
      相关资源
      最近更新 更多