You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate Classes while importing clickhouse-jdbc #2474
While importing in maven project only this dependency
com.clickhouse
clickhouse-jdbc
0.7.2
http
I receive the following warnings:
[WARNING] Found duplicate and different classes in [com.clickhouse:clickhouse-data:0.7.2, com.clickhouse:clickhouse-jdbc:0.7.2:jar:http, com.clickhouse:jdbc-v2:0.7.2]:
[WARNING] com.clickhouse.data.stream.Lz4InputStream
[WARNING] com.clickhouse.data.stream.Lz4OutputStream
This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!
The warning does not occur with the standard artifact in 0.11.2 (the latest release). It still occurs with the shaded artifacts: the all and all-dependencies classifiers, and com.clickhouse:clickhouse-jdbc-all.
The http classifier from the report is not published since 0.9.0. The packaging on main did not change after 0.11.2.
Test: a Maven project with one dependency, mvn org.basepom.maven:duplicate-finder-maven-plugin:2.0.1:check, Maven 3.9.15, JDK 17.
Dependency
Result
clickhouse-jdbc:0.7.2, classifier http
Same warning as the report
clickhouse-jdbc:0.11.2, no classifier
No duplicates. A SELECT through JDBC works (server 26.10)
clickhouse-jdbc:0.11.2, classifier all, exclusion *:*, plus slf4j-api
No duplicates. A SELECT through JDBC works
Output for classifier all (one of four groups):
[WARNING] Found duplicate and different classes in [com.clickhouse:clickhouse-data:0.11.2, com.clickhouse:clickhouse-jdbc:0.11.2:jar:all]:
[WARNING] com.clickhouse.data.UnloadableClassLoader
[WARNING] com.clickhouse.data.format.JsonStreamUtils
[WARNING] com.clickhouse.data.stream.Lz4InputStream
[WARNING] com.clickhouse.data.stream.Lz4OutputStream
[WARNING] com.clickhouse.data.value.ClickHouseBitmap
The other groups are with client-v2 (11 classes, for example com.clickhouse.client.api.Client), jdbc-v2 (9 classes, for example com.clickhouse.jdbc.ConnectionImpl) and clickhouse-http-client (2 classes).
Cause: an artifact with a classifier uses the POM of the main artifact. The clickhouse-jdbc 0.11.2 POM declares clickhouse-data, clickhouse-client, clickhouse-http-client, client-v2 and jdbc-v2 as compile dependencies. Thus Maven adds these jars next to the all jar, which already contains their classes. The clickhouse-jdbc-all 0.11.2 POM declares the same modules as direct dependencies. The copies are different because the shaded copy refers to relocated packages: Lz4InputStream in the all jar uses com.clickhouse.client.internal.net.jpountz.lz4.LZ4Factory, and the copy in clickhouse-data uses net.jpountz.lz4.LZ4Factory. The JVM loads the copy that is first on the classpath.
Workaround for the all classifier: exclude all transitive dependencies, and add slf4j-api, because the all jar does not contain SLF4J. Without slf4j-api, DriverManager.getConnection fails with No suitable driver found (cause: NoClassDefFoundError: org/slf4j/LoggerFactory).
Open: the shaded artifacts still have the problem. docs/integration-jdbc.md describes the all artifact as "a single self-contained archive" and does not mention the exclusions.
Activity
github-actions commentedon Jun 28, 2026
This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!
chernser commentedon Nov 23, 2026
@polyglotAI-bot
please verify this is not the case for the latest release
polyglotAI-bot commentedon Nov 24, 2026
The warning does not occur with the standard artifact in 0.11.2 (the latest release). It still occurs with the shaded artifacts: the
allandall-dependenciesclassifiers, andcom.clickhouse:clickhouse-jdbc-all.The
httpclassifier from the report is not published since 0.9.0. The packaging onmaindid not change after 0.11.2.Test: a Maven project with one dependency,
mvn org.basepom.maven:duplicate-finder-maven-plugin:2.0.1:check, Maven 3.9.15, JDK 17.clickhouse-jdbc:0.7.2, classifierhttpclickhouse-jdbc:0.11.2, no classifierSELECTthrough JDBC works (server 26.10)clickhouse-jdbc:0.11.2, classifierallclickhouse-jdbc:0.11.2, classifierall-dependenciesclickhouse-jdbc-all:0.11.2clickhouse-jdbc:0.11.2, classifierall, exclusion*:*, plusslf4j-apiSELECTthrough JDBC worksOutput for classifier
all(one of four groups):The other groups are with
client-v2(11 classes, for examplecom.clickhouse.client.api.Client),jdbc-v2(9 classes, for examplecom.clickhouse.jdbc.ConnectionImpl) andclickhouse-http-client(2 classes).Cause: an artifact with a classifier uses the POM of the main artifact. The
clickhouse-jdbc0.11.2 POM declaresclickhouse-data,clickhouse-client,clickhouse-http-client,client-v2andjdbc-v2as compile dependencies. Thus Maven adds these jars next to thealljar, which already contains their classes. Theclickhouse-jdbc-all0.11.2 POM declares the same modules as direct dependencies. The copies are different because the shaded copy refers to relocated packages:Lz4InputStreamin thealljar usescom.clickhouse.client.internal.net.jpountz.lz4.LZ4Factory, and the copy inclickhouse-datausesnet.jpountz.lz4.LZ4Factory. The JVM loads the copy that is first on the classpath.Workaround for the
allclassifier: exclude all transitive dependencies, and addslf4j-api, because thealljar does not contain SLF4J. Withoutslf4j-api,DriverManager.getConnectionfails withNo suitable driver found(cause:NoClassDefFoundError: org/slf4j/LoggerFactory).Open: the shaded artifacts still have the problem.
docs/integration-jdbc.mddescribes theallartifact as "a single self-contained archive" and does not mention the exclusions.