Skip to content

CAMEL-24400: camel-jbang - honor camel.jbang.camel-version system property - #26023

Closed
chala2001 wants to merge 1 commit into
apache:mainfrom
chala2001:fix/CAMEL-24400
Closed

CAMEL-24400: camel-jbang - honor camel.jbang.camel-version system property#26023
chala2001 wants to merge 1 commit into
apache:mainfrom
chala2001:fix/CAMEL-24400

Conversation

@chala2001

@chala2001 chala2001 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

camel export documents camel.jbang.camel-version as a supported option, but setting it as a
system property had no effect. The exported project kept the default Camel version, while the
equivalent --camel-version flag worked, so the two ways of setting the same thing disagreed.

Export.overrideFromSystemProperties() only read the Quarkus platform and
camel.jbang.camelSpringBootVersion. The Camel version was read from application.properties
but had no system property path, unlike camelSpringBootVersion which has both. This adds the
missing line so the two options behave the same way.

Reproducer from the issue:

camel export --runtime=quarkus -Dcamel.jbang.camel-version=4.8.0 hello.java

Before this change the exported pom used the running Camel version, after it the pom uses 4.8.0.

ExportTest#shouldOverrideCamelVersionFromSystemProperty was added next to the existing Spring Boot
and Quarkus system property tests. It asserts the exported pom imports camel-bom at the requested
version. With the fix reverted it fails with expected: "4.13.0" but was: "4.23.0-SNAPSHOT", which
is the symptom described in the issue.

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

CAMEL-24400

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.

  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

AI-assisted contributions

  • If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., Co-authored-by trailers) and the PR description identifies the AI tool used.

Claude Code on behalf of chala2001

…perty

Export read only the Quarkus platform and camelSpringBootVersion from system
properties, so -Dcamel.jbang.camel-version was ignored while the equivalent
--camel-version flag worked. Read the Camel version there too, the same way
camelSpringBootVersion already is.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the reason for this - its not documented you can do that

@chala2001

Copy link
Copy Markdown
Contributor Author

You're right, I checked and the docs don't support this.

camel.jbang.camel-version is documented as a configuration option, but only for
camel config set / the camel-cli.properties files — CamelJBangConstants says as much
("options that can be defined in application.properties"). Nothing documents it as a -D
system property. The -Dcamel.jbang.* examples in the docs are camel.jbang.version, which
is a different option, and I think that's what the issue conflated.

The one thing that made it look intentional is that Export.overrideFromSystemProperties()
already reads the Quarkus platform and camel.jbang.camelSpringBootVersion from system
properties, so camel-version is the odd one out in that method. Whether that's worth making
consistent, or whether those shouldn't be there either, is your call.

Happy to close this and CAMEL-24400 as invalid if the -D route isn't meant to be supported.

@davsclaus

Copy link
Copy Markdown
Contributor

the quarkus is a very special outliner as its a pain to align as quarkus and camel quarkus has its own version and release scheme.

and we dont want 3 different ways of doing stuff.

you are welcome to close, and keep feedback on camel jbang coming thanks 🙏

@davsclaus

Copy link
Copy Markdown
Contributor

closing

@davsclaus davsclaus closed this Sep 2, 2026
@davsclaus

Copy link
Copy Markdown
Contributor

And btw the -D is for jbang itself to kick of camel cli using a specific version, its jbang handling this in
https://github.com/apache/camel/blob/main/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java#L23

This is a bit of a "hack" as jbang is not very flexible, and we needed this during the build up for camel jbang.
The launcher does not support this as its a fat-jar for that given camel version.

And over time if/when we drop jbang then that feature will be gone as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants