Closed jg-cantaa closed 1 month ago
/cc @geoand (jib,kubernetes), @iocanel (kubernetes), @quarkusio/devtools (maven)
cc @radcortez
I've tried it, and it works. Do you have an application.properties
sitting in the exact location? It is required to load profile properties files: https://quarkus.io/guides/config-reference#profile-aware-files
A colleague was able to fix it. Apparently it was due to some filtering set to true in the <resources>
section for the resources folder?
I guess this is not really a quarkus issue, although I wish that quarkus would add documentation on how to idiomatically set configuration at build time
Thanks for the update
Describe the bug
My original goal is to specify properties at build-time. (e.g. specifying quarkus.datasource.jdbc.url at build-time in CI)
I have a POM file with several profiles like this:
In CI we run maven with the profiles flag "-P azureDevops,$(branchName)". This configuration passes CI and deploys, but at runtime Quarkus complains that the Datasource is not configured:
This is somewhat expected as quarkus cannot read the properties from the pom. As a solution to this I have found the properties-maven-plugin from org.codehaus.mojo. Utilizing their plugin like this:
Which I tested locally to produce an application-develop.properties in the target folder. Since quarkus uses the develop profile it should then load the values from there.
Expected behavior
I expected quarkus to not have a problem with this plugin, as it just writes properties to a file in the target folder.
Actual behavior
Once the plugin is added, quarkus fails with the message:
This indicates to me that it has problems with the properties set in the profile once the plugin is enabled. Without the plugin it works fine.
I have even looked at the source of the plugin (https://github.com/mojohaus/properties-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/properties/WriteActiveProfileProperties.java) to see if that messes with the properties, but I could not find a reason.
Once I tried to write the property file to${project.build.outputDirectory}/test/test.properties
it passed CI again.
How to Reproduce?
No response
Output of
uname -a
orver
-
Output of
java -version
No response
Quarkus version or git rev