This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new bacb2ca8f8e CAMEL-18090: camel-main - Loading properties with profiles for prod/dev/test bacb2ca8f8e is described below commit bacb2ca8f8eb86ef784ce5c7227a78205613f272 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Mar 14 10:53:53 2024 +0100 CAMEL-18090: camel-main - Loading properties with profiles for prod/dev/test --- .../src/main/java/org/apache/camel/main/BaseMainSupport.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java index afb703f4e9d..4e5c2922c3b 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java @@ -371,8 +371,10 @@ public abstract class BaseMainSupport extends BaseService { // fallback to check if application.properties has a profile Properties prop = new Properties(); try (InputStream is - = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, "application.properties")) { - prop.load(is); + = ResourceHelper.resolveResourceAsInputStream(camelContext, "application.properties")) { + if (is != null) { + prop.load(is); + } } profile = prop.getProperty("camel.main.profile"); }