CAMEL-22544: jbang dependency update supports multi-file and --scan-routes#22208
CAMEL-22544: jbang dependency update supports multi-file and --scan-routes#22208
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
Build reactor — dependencies compiled but only changed modules were tested (6 modules)
|
...g-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/DependencyUpdateJBangTest.java
Outdated
Show resolved
Hide resolved
...g-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/DependencyUpdateJBangTest.java
Outdated
Show resolved
Hide resolved
…outes - Accept multiple target files (pom.xml or Java source files with //DEPS) - Add --scan-routes flag to sync dependencies from route definitions: - Manages only org.apache.camel dependencies - Preserves non-Camel dependencies - Removes unused Camel dependencies - Idempotent on re-execution - Route files (YAML, XML) passed as arguments are used as source files for the export pipeline dependency resolution - In scan-routes mode, Camel //DEPS in Java target files are stripped before export to prevent stale deps from being resolved Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Merge DependencyUpdateJBangTest into DependencyUpdateTest (single test class) - Use fixture files from src/test/resources for scan-routes Maven tests instead of calling Init+Export at runtime - Add input validation preventing mixed pom.xml and Java targets - Guard addMavenDeps against targetLineNumber == -1 - Clean up blank lines left by removeMavenDeps - Clarify isCamelDependency javadoc on group prefix matching - Fix PrepareCamelJBangCommandsMojo regex to match 'this' (not just 'main') as constructor arg, fixing stale metadata generation - Regenerate all jbang command metadata and docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add strict: false to gulp.src glob options so that ENOENT errors during directory traversal are warnings rather than failures. This prevents race conditions when the docs gulp build runs in parallel with tests that create and delete temporary directories. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use system temp directory instead of target/ for test working dirs and exclude .camel-jbang directories from gulpfile source glob pattern to avoid race condition with docs gulp build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
What's the status? is it ready for another round of review? If yes, you should re-request review from claudio4j so that he is aware (and others too) |
|
Claude Code on behalf of Guillaume Nodet @claudio4j Both review comments have been addressed in the latest push:
Ready for another look when you get a chance. |
# Conflicts: # docs/gulpfile.js # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-bind.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-cmd-receive.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-debug.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-copy.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-list.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dependency-update.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-explain.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-export.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-harden.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-run.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-sbom.adoc # docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-transform-route.adoc # dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json # tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelJBangCommandsMojo.java
|
Changes not staged for commit: |
JIRA: CAMEL-22544
Summary
camel dependency updatecommand to accept multiple target files (pom.xml or Java source files with//DEPS)--scan-routesflag to sync dependencies from route definitions:org.apache.cameldependencies//DEPSin Java target files are stripped before running the export pipeline, so only actual route-based dependencies are resolvedPrepareCamelJBangCommandsMojoregex to matchthis(not justmain) as constructor arg, fixing stale metadata generationstrict: falsetogulp.srcglob options so ENOENT errors during directory traversal (when test temp dirs are cleaned up concurrently) are warnings instead of failuresTest plan
DependencyUpdateTest(Maven pom.xml with quarkus, spring-boot, main runtimes) passessrc/test/resources/dependency-update/(no Init+Export at runtime):--scan-routesadds new deps from routes (Maven, all runtimes)--scan-routesremoves unused Camel deps from pom.xml--scan-routesadds and removes deps simultaneously//DEPStests (inline fixtures)://DEPSupdate--scan-routespreserves non-Camel//DEPSin JBang files--scan-routesis idempotent on re-execution