Claus Ibsen created CAMEL-24247:
-----------------------------------
Summary: camel export produces duplicate
camel-micrometer-prometheus dependency in pom.xml
Key: CAMEL-24247
URL: https://issues.apache.org/jira/browse/CAMEL-24247
Project: Camel
Issue Type: Bug
Components: camel-jbang
Reporter: Claus Ibsen
When exporting a JBang project that has both {{camel:observability-services}}
in {{camel.jbang.dependencies}} and {{camel.metrics.enabled=true}}, the
exported pom.xml contains {{camel-micrometer-prometheus}} twice.
*Root cause:* {{ExportCamelMain.resolveDependencies()}} calls
{{super.resolveDependencies()}} which includes deduplication (ExportBaseCommand
lines 810-822), but then adds {{camel-micrometer-prometheus}} again at lines
301-306 based on the metrics property — after dedup has already run. No second
dedup pass is performed, so the final dependency set contains both entries
which produce two identical {{<dependency>}} blocks in the pom.xml.
*Steps to reproduce:*
# Create a JBang project with {{application.properties}} containing:
#* {{camel.jbang.dependencies=camel-console,camel:observability-services}}
#* {{camel.metrics.enabled=true}}
# Run {{camel export --dir=code}}
# Check {{code/pom.xml}} — {{camel-micrometer-prometheus}} appears twice
*Fix:* Either move the dedup to run after the subclass additions, or have
ExportCamelMain check whether the dependency is already present before adding
it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)