Dev kumar
Dev kumar

Reputation: 7

Spring PropertyPlaceholderConfigurer on Cloudbees cannot resolve property

My jenkins job copies the properties files (secret plugin) as follows

if [[ ! -d ~/.app ]]
then
mkdir ~/.app
fi
cp ${SECRET}/app.properties ~/.app/app.properties

This seems to work cos I do get

And my deployed war has the following configuration

<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://.....

However, I still get Could not resolve placeholder 'app.secret' at org.springframework.beans.factory.config.PlaceholderConfigurerSupport .doProcessProperties(PlaceholderConfigurerSupport.java:209)

I do not have multiple PropertyPlaceholderConfigurer's. Any help will be much appreciated.

Upvotes: 0

Views: 289

Answers (1)

nicolas de loof
nicolas de loof

Reputation: 2633

DEV@Cloud build slaves and RUN@Cloud server nodes are distinct hosts. Your jenkins job can't be used to prepare runtime environment. To inject such configuration, use configuration parameters

Upvotes: 1

Related Questions