File tree Expand file tree Collapse file tree
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,21 @@ protected Integer doExport() throws Exception {
9595 }
9696 }
9797
98+ // auto-detect application.properties and include it
99+ {
100+ String name = baseDir .resolve ("application.properties" ).toString ();
101+ if (Files .exists (Paths .get (name )) && !files .contains (name )) {
102+ files .add (name );
103+ }
104+ }
105+ if (profile != null ) {
106+ // need to include profile application properties if exists
107+ String name = baseDir .resolve ("application-" + profile + ".properties" ).toString ();
108+ if (Files .exists (Paths .get (name )) && !files .contains (name )) {
109+ files .add (name );
110+ }
111+ }
112+
98113 // application.properties
99114 doLoadAndInitProfileProperties (baseDir .resolve ("application.properties" ));
100115 if (profile != null ) {
Original file line number Diff line number Diff line change @@ -728,6 +728,13 @@ private int run() throws Exception {
728728 addDependencies (pomDependencies .toArray (new String [0 ]));
729729 }
730730
731+ // auto-detect application.properties and include it
732+ if (!empty && sourceDir == null ) {
733+ String appProps = baseDir .resolve ("application.properties" ).toString ();
734+ if (Files .exists (Paths .get (appProps )) && !files .contains (appProps )) {
735+ files .add (appProps );
736+ }
737+ }
731738 if (profile != null ) {
732739 // need to include profile application properties if exists
733740 String name = baseDir + "/application-" + profile + ".properties" ;
You can’t perform that action at this time.
0 commit comments