[
https://issues.apache.org/jira/browse/CAMEL-21960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18038456#comment-18038456
]
Cameron Fitzwater commented on CAMEL-21960:
-------------------------------------------
I would prefer to see the use of the `--properties` option be the ONLY
mechanism for loading (not through <files> passed in the command). I would say
there should be some default/magic behavior if the --properties is not set
(e.g., looks for and use an application.properties file – otherwise, the user
must explicitly set).
The --profile is interesting... almost seems like duplication in this aspect,
but it is probably doing more than just looking for the named-conventioned
file...?
I would tail on to this, where I would actually prefer to see that the only
<files> allowed in the `run` or `export` are actual DSL based files... and I
would argue that there should be a new `--resources` option to load additional
files (and directories) to the classpath (to kind of mirror the copying of
files and directories into `/src/main`). If some other type of file is passed,
then a warning should then be thrown that the .pdf file will be ignored, and to
use --resources option if the file is needed.
If you combine all of these, you'd get something like:
camel run * --properties=application.properties
--resources=keystores/*,somefile.pdf
camel run main.camel.yaml --properties=application.properties
--resources=keystores/*,somefile.pdf
camel run * --resources=keystores/*,somefile.pdf
... where these all effectively do the same thing (* would only allow the DSL
files). This proposal seems very logical and straightforward.
> camel-jbang - Should camel run | export auto-detect application.properties
> and include the file always
> ------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-21960
> URL: https://issues.apache.org/jira/browse/CAMEL-21960
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Priority: Major
> Fix For: 4.x
>
>
> If you use camel run foo.camel.yaml then its only this file that are
> included. However if you have application.properties file in the same folder,
> and want to include this then you need to use camel run foo.camel.yaml
> application.properties (or use camel run *).
> So the question is should we auto detect application.properties "magically"
> in camel-jbang and include this always. And then we need to do this for
> export and other commands as well.
> There is. the --profile option to choose another properties file, so you can
> have --profile=test and then have a application-test.properties file. So
> there is some logic we can use to say it should auto-detect
> application.properties and use it out of the box.
> If you do not want that, you can use camel run foo.camel.yaml --profile=false
> or something.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)