I have a Springboot project and I'm trying to deploy it to the Azure web app via Jenkins job. Created maven project in Jenkins for compiling, testing, and deploying the projects are in the below name.
application.properties
to the bitbucket branch.Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'azureADUtils': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'azure.openid.config.url' in value "${azure.openid.config.url}"
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'azure.config.url' in value "${azure.config.url}".
It is clearly saying it is expecting the value ${azure.config.url}
which is available in my app.properties
which I haven't committed in bitbucket.
Then how can I configure the properties file in Jenkins to make the build successful? I tried adding the app.properties
in Manage Jenkins->Managed files of Jenkins, But it is not taking my properties file.
How to add and configure my app.properties
in the Jenkins job? is there any other way to add my properties?
You should be able to copy your managed files to your build in Jenkins like this plugin suggests.
By IMO you should reconsider your approach, the property file is an integrated part of the project. Does your entire property file is sensitive? Perhaps you could just leave the sensitive values with an environment variable placeholder, like this:
non-sensitive-property=value1234
sensitive-property=${MY_ENV_VAR}
See more details here
You can pass your property while executing mvn command on Jenkins, considering you are using mvnw / mvn:
./mvnw spring-boot:run \
-Dspring-boot.run.arguments="--azure.config.url=https://url"
Or
./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="\
-Dazure.config.url=https://url"
Hopefully this is what you are looking for.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.