davsclaus opened a new pull request, #28122:
URL: https://github.com/apache/camel/pull/28122

   [CAMEL-25830](https://issues.apache.org/jira/browse/CAMEL-25830): `camel run 
--source-dir=.` without `--name` named 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 it is not alphabetical), so a project could get another 
name on another machine.
   
   The `camel_run` tool 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.
   
   ## What
   
   - **A run of a whole directory** (`--source-dir`, or a directory as the 
argument) without `--name` is named after the directory.
     - `.` is the working directory.
     - A folder of a project layout (`src`, `main`, `resources`, `java`, 
`camel` or `routes`) gives way to the first parent with another name, so 
`src/main/resources/camel` is named after the project.
   - **A run of files that are given** keeps the name of the first file, as 
before: the user chose the files, and the first one is usually the main route.
   - `--name`, and `camel.main.name` in application.properties, still win.
   - The description of `--name` says what the default is (in the generated 
docs of `camel run`, `camel dev` and `camel debug`).
   
   ## Tests
   
   - `RunTest` (1 more): the name of a directory, of a folder of a project 
layout under a project, of the working directory, and no name for `/src`.
   - End to end, with the camel launcher built from this branch, `camel run 
--source-dir=.` in a folder `orders-app` with `route.camel.yaml` and 
`Order.java`:
     - before: `Apache Camel 4.24.0-SNAPSHOT (Order) is starting`
     - after: `Apache Camel 4.24.0-SNAPSHOT (orders-app) is starting`
     - with `camel.main.name = from-props` in application.properties: 
`(from-props)`
   - All tests of camel-jbang-core pass (2306, 2 skipped, and 237).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to