This is an automated email from the ASF dual-hosted git repository.
oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git
The following commit(s) were added to refs/heads/main by this push:
new 0f146a34f4 Fix #1767: document the JDBC drivers to add and bundle the
PostgreSQL driver (#1854)
0f146a34f4 is described below
commit 0f146a34f420812f08f36d152afd3e35303c7f9e
Author: Andrea Cosentino <[email protected]>
AuthorDate: Thu Nov 5 11:36:05 2026 +0100
Fix #1767: document the JDBC drivers to add and bundle the PostgreSQL
driver (#1854)
* Fix #1767: document the JDBC drivers to add and bundle the PostgreSQL
driver
The SQL Server, MySQL, MariaDB and Oracle Kamelets do not declare their
JDBC driver, so the generated connectors do not ship it and the task
fails with "Cannot load JDBC driver class" until the driver jar is added
to the connector's plugin directory. The documentation never said so.
The PostgreSQL Kamelets do declare org.postgresql:postgresql, but the
parent pom manages that artifact with test scope. The generated
connector poms inherit the scope and the assembly leaves the driver out:
the 4.22.0 packages of camel-postgresql-source/sink-kafka-connector on
Maven Central contain no driver.
- parent/pom.xml: drop the test scope from the managed PostgreSQL
driver. itests-jdbc and itests-sql already declare the test scope
themselves.
- getting-started-with-packages.adoc: list the connectors that need a
driver, with the driver class and artifact, and explain how to add it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Andrea Cosentino <[email protected]>
* Fix #1767: align the managed PostgreSQL driver with the Kamelet version
Without the test scope, dependency-review treats the driver managed in
the parent pom as a runtime dependency, and its version, 42.7.11, is
affected by GHSA-j92g-9f8w-j867 (CVE-2026-54291, fixed in 42.7.12).
Align version.postgres with the 42.7.13 that the PostgreSQL Kamelets
declare and the connectors ship, so the itests use the same driver.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Andrea Cosentino <[email protected]>
---------
Signed-off-by: Andrea Cosentino <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.../getting-started-with-packages.adoc | 24 ++++++++++++++++++++++
parent/pom.xml | 4 ++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git
a/docs/modules/ROOT/pages/user-guide/getting-started/getting-started-with-packages.adoc
b/docs/modules/ROOT/pages/user-guide/getting-started/getting-started-with-packages.adoc
index 1c946b2528..a57f31f5e6 100644
---
a/docs/modules/ROOT/pages/user-guide/getting-started/getting-started-with-packages.adoc
+++
b/docs/modules/ROOT/pages/user-guide/getting-started/getting-started-with-packages.adoc
@@ -6,3 +6,27 @@ The Camel-Kafka-connector connectors can be used also as
packages to unpack in y
If you already set up Zookeeper, Kafka, and Kafka Connect, using
camel-kafka-connector's connector is pretty fast: you can download one or more
archives (we provide zip and tar.gz formats) and extract their content into the
Kafka Connect environment, specifically in Kafka Connect’s plugin path. Doing
this will require to specify the plugin path in your worker configuration (e.g.
connect-distributed.properties or connect-standalone.properties) using the
plugin.path configuration property.
You can download the connectors packages from the
xref:reference/index.adoc[Connectors List]
+
+[[GettingStartedwithpackages-JDBCDrivers]]
+== Connectors that need a JDBC driver
+
+The database connectors connect through the JDBC driver of their database. The
PostgreSQL connectors (`camel-postgresql-source-kafka-connector` and
`camel-postgresql-sink-kafka-connector`) include their driver. The following
connectors do not, because the Kamelets they are generated from do not declare
it, so you have to add the driver yourself:
+
+[options="header"]
+|===
+| Connectors | Driver class | Driver artifact on Maven Central
+| `camel-sqlserver-source-kafka-connector`,
`camel-sqlserver-sink-kafka-connector` |
`com.microsoft.sqlserver.jdbc.SQLServerDriver` |
`com.microsoft.sqlserver:mssql-jdbc`
+| `camel-mysql-source-kafka-connector`, `camel-mysql-sink-kafka-connector` |
`com.mysql.cj.jdbc.Driver` | `com.mysql:mysql-connector-j`
+| `camel-mariadb-source-kafka-connector`, `camel-mariadb-sink-kafka-connector`
| `org.mariadb.jdbc.Driver` | `org.mariadb.jdbc:mariadb-java-client`
+| `camel-oracle-database-source-kafka-connector`,
`camel-oracle-database-sink-kafka-connector` |
`oracle.jdbc.driver.OracleDriver` | `com.oracle.database.jdbc:ojdbc11`
+|===
+
+Copy the driver jar into the directory of the unpacked connector in the Kafka
Connect plugin path, next to the connector's own jars. Kafka Connect loads each
plugin directory with its own class loader, so a driver in another plugin's
directory is not visible to the connector. Without the driver, the task fails
with `Cannot load JDBC driver class`. For example, for the SQL Server source
connector:
+
+[source,bash]
+----
+cd <plugin.path>/camel-sqlserver-source-kafka-connector
+curl -LO
https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/13.6.2.jre11/mssql-jdbc-13.6.2.jre11.jar
+----
+
+Then restart the Kafka Connect worker so that it loads the new jar.
diff --git a/parent/pom.xml b/parent/pom.xml
index c8863223c2..c87b1d6d90 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -35,7 +35,7 @@
<version.java>17</version.java>
<version.guava>20.0</version.guava>
<version.javax.annotation-api>1.3.2</version.javax.annotation-api>
- <version.postgres>42.7.11</version.postgres>
+ <version.postgres>42.7.13</version.postgres>
<version.jctools>3.3.0</version.jctools>
<!-- okhttp/mockwebserver for itests: owned here because
camel-dependencies
renamed squareup-okhttp-version to squareup-okhttp5-version in
4.21 -->
@@ -258,11 +258,11 @@
<scope>test</scope>
</dependency>
+ <!-- no scope here: the PostgreSQL connectors bundle the driver,
test modules declare the test scope themselves -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${version.postgres}</version>
- <scope>test</scope>
</dependency>
<dependency>