oscerd opened a new pull request, #1856: URL: https://github.com/apache/camel-kafka-connector/pull/1856
Fixes #1195. ### Problem `UpdateDocComponentsListMojo` regenerates the connector table in `docs/modules/ROOT/pages/reference/index.adoc` and the connectors block of `nav.adoc`. It selected connector modules by looking for `*SinkTask*` / `*SourceTask*` files. #1788 removed those generated task classes in July, so on a clean checkout only `camel-syslog-kafka-connector`, whose classes are hand-written, still matches. Any build from a clean checkout then rewrites both files down to that one connector. CI does not check for regenerated files, so nobody noticed. Locally, stale `target/` directories from older builds can hide it. Reproduced with the unmodified plugin: running the goal on the `connectors` module of a clean worktree deleted 568 lines from the two files and left only syslog. ### Change - **Detection.** A module is a sink and/or source connector module when it has `src/main/resources/META-INF/services/org.apache.kafka.connect.sink.SinkConnector` or `...source.SourceConnector`. These are the KIP-898 manifests every connector module has shipped since #1644, the hand-maintained syslog module included. Only `src/` is checked, so build output cannot change the list. - **#1195.** The values marked `//TODO: make these configurable` are now mojo parameters, with today's values as defaults. They are `xrefConnectorLinkPrefix`, `sinkConnectorLinkSuffix`, `sourceConnectorLinkSuffix`, `docsModuleDir`, `connectorsIndexFile` and `navFile`, and `connectors/pom.xml` does not change. This follows the direction given on the earlier attempts (#1198, #1206): mojo parameters rather than a separate configuration class. - **Cleanup.** The duplicated sink/source link code is now one helper. The `coap+tcp` / `coaps+tcp` mapping is kept, because those schemes still exist in the Camel 4.22 catalog. The `solrCloud` case is dropped, because nothing in Camel 4.22 or Kamelets 4.22 can produce that module. The direct `commons-io` dependency is no longer used and is removed. - **Tests.** These are the plugin's first unit tests. They cover manifest detection, including modules that only have stale `target/` output, link mapping, rewriting only between the markers, and configured paths. ### Verification - `./mvnw -pl tooling/camel-kafka-connector-docs-maven-plugin -Psourcecheck install` runs 4 tests with 0 failures, and checkstyle is clean. - I regenerated the docs on a clean worktree, both with the goal alone and through the `connectors` module's `process-resources` lifecycle, generator included. `git diff -- docs/` is empty in both cases, and 188 connectors are listed as on `main`. - The full reactor build `./mvnw clean verify -DskipTests` succeeds and leaves `docs/` unchanged. Note, unrelated to this change: on `main` the generator rewrites the `"version"` in every `connectors/*/src/generated/resources/*.json` from `4.22.0-SNAPSHOT` to `4.22.1-SNAPSHOT`, because nothing was regenerated after the post-release version bump. Those files are not part of this PR. _Claude Code on behalf of Andrea Cosentino_ 🤖 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]
