davsclaus opened a new pull request, #28737: URL: https://github.com/apache/camel/pull/28737
_Claude Code on behalf of davsclaus_ Part of [CAMEL-24727](https://issues.apache.org/jira/browse/CAMEL-24727), after #28735 (1c-4), which made `SilentRunDependencyResolver` the resolver of every export. To find the dependencies of the exported project, `camel export` boots the integration silently. That run always used the `dev` profile, whatever the export's `--profile` was. So `camel export --profile=prod` copied `application-prod.properties` into the project, but found the dependencies with `application-dev.properties`: a component that only the prod properties use (for example as the target of an endpoint, `to: "{{target}}"`) was missing from the pom, and the project failed when it started. The old silent run through `camel run` did the same; this is not a regression of the refactoring. ## Changes - **The silent run uses the profile of the export.** `SilentRunDependencyResolver` passes `ExportRequest.profile` to the run, and uses `dev`, as `camel run` does, when the export has none. An export without `--profile` (or with `--profile=dev`) is unchanged: the golden expected files are the same. - **The security policy of the profile does not fail the export.** Camel Main's `prod` profile sets `camel.security.policy=fail`, which stops Camel on an insecure option (such as `camel.main.devConsoleEnabled=true`) or a secret in plain text. With the previous change, `camel export --profile=prod` of such a project failed with "Security policy violations detected", where it exported before. The silent run only finds the dependencies, so it overrides the policy to `warn`; the exported project keeps its properties, and the policy applies when it runs. An explicit `camel.security.policy=fail` in the properties is overridden as well, as the export does not run the routes; the upgrade guide says so. - **Docs.** The export page says which profile the export boots with, and the 4.24 upgrade guide has an entry, next to the other export changes of #28735. ## Tests - `RunExportGoldenTest`: a new case, `profile-prod`, where `application.properties` sends to `log:` and `application-prod.properties` to `seda:`. Exported with `--profile=prod`, the pom has `camel-seda`. The run side of the case is pinned too. All other expected files are unchanged. - `SilentRunDependencyResolverTest`: - `theSilentRunBootsWithTheProfileOfTheExport`: the same route, exported with the prod profile (the pom has `camel-seda`) and without a profile (the pom has `camel-log` and not `camel-seda`). It fails without the fix. - `theSecurityPolicyOfTheProdProfileDoesNotFailTheExport`: a prod profile with `camel.main.devConsoleEnabled=true` exports. It fails without the override. - camel-jbang-export: 129 tests pass. - camel-jbang-core: 2497 tests in the default fork and 287 in the serial fork. The only failures, `EvalSimpleTest` (it runs the Camel installed with JBang) and 9 tests of the AI tools, fail on `main` locally too. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
