Skip to content

CAMEL-24247: camel-jbang - Fix duplicate camel-micrometer-prometheus in exported pom.xml - #25035

Merged
davsclaus merged 2 commits into
mainfrom
fix/CAMEL-24247
Jul 24, 2026
Merged

CAMEL-24247: camel-jbang - Fix duplicate camel-micrometer-prometheus in exported pom.xml#25035
davsclaus merged 2 commits into
mainfrom
fix/CAMEL-24247

Conversation

@davsclaus

@davsclaus davsclaus commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Claude Code on behalf of davsclaus

Fixes CAMEL-24247.

When exporting a JBang project with metrics enabled, the exported pom.xml contains camel-micrometer-prometheus twice. The base class ExportBaseCommand.resolveDependencies() adds camel:micrometer-prometheus (shorthand format) at line 778, then the subclass ExportCamelMain.resolveDependencies() adds mvn:org.apache.camel:camel-micrometer-prometheus (full format) at line 305. Since these are different strings, the Set does not deduplicate them, and both end up in the generated pom.xml.

Fix: Switch the subclass to use camel:micrometer-prometheus shorthand (matching the base class format) so the Set naturally deduplicates. Applied the same fix for camel-health. No removeIf workaround needed.

Test plan

  • Added shouldNotDuplicateMetricsDependency test that exports with camel.management.metricsEnabled=true and asserts camel-micrometer-prometheus appears exactly once
  • All 856 module tests pass

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

…in exported pom.xml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core

🔬 Scalpel shadow comparison — Scalpel: 7 tested, 8 compile-only — current: 6 all tested

Maveniverse Scalpel detected 15 affected modules (current approach: 6).

⚠️ Modules only in Scalpel (9)
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-launcher
  • coverage

Skip-tests mode would test 7 modules (1 direct + 6 downstream), skip tests for 8 (generated code, meta-modules)

Modules Scalpel would test (7)
  • camel-jbang-core
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
Modules with tests skipped (8)
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-launcher
  • coverage

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 1 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (15 modules)
  • Camel :: Coverage
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher
  • Camel :: Launcher :: Container

⚙️ View full build and test results

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Claude Code on behalf of davsclaus

The removeIf pattern s.contains("camel-micrometer-prometheus") does not match the camel:micrometer-prometheus entry added by the base class (ExportBaseCommand.java:778) — the colon vs dash means the substring check fails, so the duplicate persists.

Suggested approach: drop the new removeIf line and change line 305 to use camel:micrometer-prometheus shorthand instead of the mvn: format. The Set naturally deduplicates the identical string the base class already added. The same cleanup could be done for camel-health at line 309 → camel:health for consistency.

This review does not replace specialized tools such as CodeRabbit, Sourcery, or SonarCloud.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Use camel: shorthand instead of mvn: format for micrometer-prometheus and
health dependencies. The Set naturally deduplicates identical strings,
avoiding the need for a removeIf workaround. Added test to verify no
duplicate camel-micrometer-prometheus in exported pom.xml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus
davsclaus requested a review from oscerd July 23, 2026 08:11
@davsclaus
davsclaus merged commit e65e2a5 into main Jul 24, 2026
5 checks passed
@davsclaus
davsclaus deleted the fix/CAMEL-24247 branch July 24, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant