[
https://issues.apache.org/jira/browse/CAMEL-25830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-25830.
---------------------------------
Resolution: Fixed
> camel-jbang - camel run of a whole directory without --name is named after
> the first file the directory lists, not after the directory
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-25830
> URL: https://issues.apache.org/jira/browse/CAMEL-25830
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> {{camel run --source-dir=.}} without {{--name}} names the integration after
> the first Java, XML or YAML file, in the order that {{Files.list}} gives. The
> same goes for {{camel run <dir>}}, which runs the directory as a source
> directory. That first file can be any file, such as a Java class that a route
> uses. The order depends on the file system. On Linux (ext4) it is not
> alphabetical, so the same project can get another name on another machine.
> The camel_run tool of the MCP server runs a whole directory like that when no
> name is given. In a benchmark of Oct 18-19 2026, it answered "Started Order
> (pid 46489)" for the project {{contracts-rest-code-first}}, named after its
> {{Order.java}}. The model then looked the integration up by the name of the
> directory, which found nothing. The PR of CAMEL-25784 keeps the name after a
> failed restart, but a new run without a name is still named after the first
> file.
> Proposal:
> * A run of a whole directory ({{--source-dir}}, or a directory as the
> argument) is named after the directory. {{.}} is the working directory. A
> directory with a name that says nothing about the app, such as {{src}},
> {{main}}, {{resources}}, {{camel}} or {{routes}}, gives way to the first
> parent with another name.
> * A run of files that are given ({{camel run a.yaml b.yaml}}, or a shell
> glob) keeps the name of the first file. The user chose the files, and the
> first one is usually the main route.
> * {{--name}}, and {{camel.main.name}} in application.properties, still win.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)