Skip to content

Conversation

shivam2680
Copy link
Collaborator

@shivam2680 shivam2680 commented Aug 7, 2025

Description

Implement proper POM metadata for the thin JAR artifact following industry standards to address dependency introspection limitations. This change enables users to view, pin, exclude, and override dependencies when using the thin JAR, matching industry standard approach with separate artifact IDs.

  • Fat JAR: com.databricks:databricks-jdbc:1.0.8-oss (minimal POM, no dependencies)
  • Thin JAR: com.databricks:databricks-jdbc-thin:1.0.8-oss (full dependency metadata)

Testing

  1. Build verification
mvn clean install -Plocal-deploy

Build completes successfully
install phase succeeds without POM related errors

  1. Local Repo verification
    Both artifacts installed at ~/.m2/repository/com/databricks/databricks-jdbc/1.0.8-oss/
    Fat JAR (Uber):
~/.m2/repository/com/databricks/databricks-jdbc/1.0.8-oss/
├── databricks-jdbc-1.0.8-oss.jar (33MB self-contained)
└── databricks-jdbc-1.0.8-oss.pom (minimal POM - no dependencies)

Thin JAR:

~/.m2/repository/com/databricks/databricks-jdbc-thin/1.0.8-oss/
├── databricks-jdbc-thin-1.0.8-oss.jar (2.5MB thin JAR)
└── databricks-jdbc-thin-1.0.8-oss.pom (full dependency metadata)
  1. Thin jar usage Test
    Create test project with thin jar dependency
<dependency>
    <groupId>com.databricks</groupId>
    <artifactId>databricks-jdbc-thin</artifactId>
    <version>1.0.8-oss</version>
</dependency>

Ran a sample test file to use the jar

  1. dependency tree check using clojure (as per ticket)
shivam.raj@KRRYR66K41 databricks-jdbc % clojure -Sdeps '{:deps {com.databricks/databricks-jdbc$thin {:mvn/version "1.0.8-oss"}}}' -Stree
org.clojure/clojure 1.12.1
  . org.clojure/spec.alpha 0.5.238
  . org.clojure/core.specs.alpha 0.4.74
com.databricks/databricks-jdbc$thin 1.0.8-oss
  . com.databricks/databricks-sdk-java 0.52.0
    X org.slf4j/slf4j-api 2.0.9 :older-version
    . org.apache.commons/commons-configuration2 2.11.0 :newer-version
      . org.apache.commons/commons-lang3 3.14.0 :newer-version
      . org.apache.commons/commons-text 1.12.0
        . org.apache.commons/commons-lang3 3.14.0
      . commons-logging/commons-logging 1.3.2 :newer-version
    X com.fasterxml.jackson.core/jackson-databind 2.15.2 :older-version
    . org.apache.httpcomponents/httpclient 4.5.14
    . commons-io/commons-io 2.14.0
    . org.json/json 20240303
    . com.google.auth/google-auth-library-oauth2-http 1.20.0
      . com.google.auto.value/auto-value-annotations 1.10.4
      . com.google.code.findbugs/jsr305 3.0.2
      . com.google.auth/google-auth-library-credentials 1.20.0
      . com.google.http-client/google-http-client 1.43.3
        . org.apache.httpcomponents/httpclient 4.5.14
        . org.apache.httpcomponents/httpcore 4.4.16
        . com.google.code.findbugs/jsr305 3.0.2
        X com.google.errorprone/error_prone_annotations 2.18.0 :older-version
        X com.google.guava/guava 30.1.1-android :older-version
        . com.google.j2objc/j2objc-annotations 2.8
        . io.opencensus/opencensus-api 0.31.1
          X io.grpc/grpc-context 1.27.2 :older-version
        . io.opencensus/opencensus-contrib-http-util 0.31.1
          . io.opencensus/opencensus-api 0.31.1
          X com.google.guava/guava 29.0-android :older-version
      . com.google.http-client/google-http-client-gson 1.43.3
        . com.google.http-client/google-http-client 1.43.3
        . com.google.code.gson/gson 2.10.1
      X com.google.guava/guava 32.0.0-android :older-version
    X com.fasterxml.jackson.datatype/jackson-datatype-jsr310 2.15.2 :superseded
      X com.fasterxml.jackson.core/jackson-annotations 2.15.2 :parent-omitted
      X com.fasterxml.jackson.core/jackson-core 2.15.2 :parent-omitted
      X com.fasterxml.jackson.core/jackson-databind 2.15.2 :parent-omitted
  X org.apache.commons/commons-configuration2 2.10.1 :superseded
    X org.apache.commons/commons-lang3 3.14.0 :parent-omitted
    X org.apache.commons/commons-text 1.11.0 :parent-omitted
    X commons-logging/commons-logging 1.3.0 :parent-omitted
  . org.apache.arrow/arrow-memory-core 17.0.0
    . com.google.code.findbugs/jsr305 3.0.2
    . org.slf4j/slf4j-api 2.0.13
  . org.apache.arrow/arrow-memory-unsafe 17.0.0
    . org.apache.arrow/arrow-memory-core 17.0.0
  . org.apache.arrow/arrow-vector 17.0.0
    . org.apache.arrow/arrow-format 17.0.0
      . com.google.flatbuffers/flatbuffers-java 24.3.25
    . org.apache.arrow/arrow-memory-core 17.0.0
    X com.fasterxml.jackson.core/jackson-core 2.17.1 :older-version
    X com.fasterxml.jackson.core/jackson-annotations 2.17.1 :older-version
    X com.fasterxml.jackson.core/jackson-databind 2.17.1 :older-version
    . com.fasterxml.jackson.datatype/jackson-datatype-jsr310 2.17.1 :newer-version
      X com.fasterxml.jackson.core/jackson-annotations 2.17.1 :older-version
      X com.fasterxml.jackson.core/jackson-core 2.17.1 :older-version
      X com.fasterxml.jackson.core/jackson-databind 2.17.1 :older-version
    . commons-codec/commons-codec 1.17.0
    . com.google.flatbuffers/flatbuffers-java 24.3.25
    . org.slf4j/slf4j-api 2.0.13
  . org.apache.arrow/arrow-memory-netty 17.0.0
    . org.apache.arrow/arrow-memory-core 17.0.0
    . org.apache.arrow/arrow-memory-netty-buffer-patch 17.0.0
      . org.apache.arrow/arrow-memory-core 17.0.0
      X io.netty/netty-buffer 4.1.110.Final :older-version
      X io.netty/netty-common 4.1.110.Final :older-version
      . org.slf4j/slf4j-api 2.0.13
    X io.netty/netty-common 4.1.110.Final :older-version
  . org.apache.httpcomponents/httpclient 4.5.14
    . org.apache.httpcomponents/httpcore 4.4.16
    X commons-logging/commons-logging 1.2 :superseded
    X commons-codec/commons-codec 1.11 :older-version
  . org.apache.thrift/libthrift 0.19.0
    X org.slf4j/slf4j-api 1.7.36 :older-version
    X org.apache.httpcomponents.client5/httpclient5 5.2.1 :older-version
    X org.apache.httpcomponents.core5/httpcore5 5.2 :older-version
    . jakarta.servlet/jakarta.servlet-api 5.0.0
    . jakarta.annotation/jakarta.annotation-api 2.1.1 :newer-version
    X org.apache.commons/commons-lang3 3.12.0 :superseded
  . org.slf4j/slf4j-api 2.0.13
  . commons-io/commons-io 2.14.0
  . com.google.code.findbugs/annotations 3.0.1
    . net.jcip/jcip-annotations 1.0
    X com.google.code.findbugs/jsr305 3.0.1 :older-version
  . com.google.guava/guava 33.0.0-jre
    . com.google.guava/failureaccess 1.0.2
    . com.google.guava/listenablefuture 9999.0-empty-to-avoid-conflict-with-guava
    . com.google.code.findbugs/jsr305 3.0.2
    . org.checkerframework/checker-qual 3.41.0
    . com.google.errorprone/error_prone_annotations 2.23.0
    . com.google.j2objc/j2objc-annotations 2.8
  . com.fasterxml.jackson.core/jackson-core 2.18.3
  . com.fasterxml.jackson.core/jackson-databind 2.18.3
    . com.fasterxml.jackson.core/jackson-annotations 2.18.3
    . com.fasterxml.jackson.core/jackson-core 2.18.3
  . com.fasterxml.jackson.core/jackson-annotations 2.18.3
  . com.nimbusds/nimbus-jose-jwt 10.0.2
  . org.bouncycastle/bcprov-jdk18on 1.78.1
  . org.bouncycastle/bcpkix-jdk18on 1.78.1
    . org.bouncycastle/bcprov-jdk18on 1.78.1
    . org.bouncycastle/bcutil-jdk18on 1.78.1
      . org.bouncycastle/bcprov-jdk18on 1.78.1
  . org.lz4/lz4-java 1.8.0
  . io.grpc/grpc-context 1.71.0
    . io.grpc/grpc-api 1.71.0
  . io.netty/netty-common 4.2.0.Final
  . io.netty/netty-buffer 4.2.0.Final
    . io.netty/netty-common 4.2.0.Final
  . org.apache.httpcomponents.client5/httpclient5 5.3.1
    X org.apache.httpcomponents.core5/httpcore5 5.2.4 :older-version
    . org.apache.httpcomponents.core5/httpcore5-h2 5.2.4
      X org.apache.httpcomponents.core5/httpcore5 5.2.4 :older-version
    X org.slf4j/slf4j-api 1.7.36 :older-version
  . org.apache.httpcomponents.core5/httpcore5 5.3.1

Additional Notes to the Reviewer

@shivam2680 shivam2680 self-assigned this Aug 7, 2025
@@ -664,7 +683,7 @@
<arg>loopback</arg>
</gpgArguments>
<!-- Custom reduced pom file for fat jar -->
<pomFile>${project.basedir}/uber-minimal-pom.xml</pomFile>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to remove the uber-minimal-pom in that case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should. I was just waiting for confirmation from @jayantsing-db

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, the purpose of minimal pom in the case of uber jar was that since the jar had all dependencies zipped in albeit shaded, we didn't want to load those dependencies again in customer env. this is for a variety of reasons:

  • wasteful
  • size of executable
  • bootstrapping time
  • unshaded dependencies creating conflicts with customer env

so if you were to use this thin pom. i see that it loads some critical dependencies which defeats the purpose stated above. so, for the fat jar, i would urge to keep the minimal pom

henceforth, i would recommend to create a separate artifact with thin as suffix and publish the thin pom and thin jar as part of that artifact. hopefully, this makes sense.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayantsing-db : I get your point. The reason we are looking to add a slim jar (other than the uber minimal) is because of competitor support and customer ask. But, we can choose not to support based on guidelines @shivam2680 Can you explore industry standards on the 3 type of JARs (especially on the uber minimal and slim jar).


<modelVersion>4.0.0</modelVersion>
<groupId>com.databricks</groupId>
<artifactId>databricks-jdbc</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own understanding: how do we decide if a new dependency be added in the thin pom or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything except test-only and build-time dependencies.
scope=test, scope=provided

pom.xml Outdated
@@ -559,6 +560,44 @@
</transformers>
</configuration>
</execution>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extraneous line

Comment on lines +567 to +569
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for local install? i see that the deploy is only signing and publishing the uber jar.

pom.xml Outdated
<execution>
<id>default-install</id>
<phase>install</phase>
<goals><goal>install</goal></goals>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: xml formatting

<version>1.3.5</version>
</dependency>
</dependencies>
</project>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a new line

pom.xml Outdated
<files>${project.build.directory}/${project.build.finalName}-thin.jar</files>
<types>jar</types>
<classifiers>thin</classifiers>
<!-- Thin JAR will be released separately with different artifactId -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the thin jar being deployed?

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this only locally installs the artifact and not publish to remote maven.

if it publishes (likely not the case now) to remote maven, we should cryptographically sign the artifact and pom

Comment on lines 53 to 76
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-core</artifactId>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-unsafe</artifactId>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<version>17.0.0</version>
</dependency>
<!-- HTTP / Thrift -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of these dependencies version should ideally match the development pom? So people adding/updating new dependencies would have to remember to add/update the dependencies here too which creates a surface for human error. Can we leverage maven module/parent system to have one place for dependency version management?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolutely, +1

<!-- Core SDK -->
<dependency>
<groupId>com.databricks</groupId>
<artifactId>databricks-sdk-java</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I don't see this being removed from the main pom? do we absolutely need all deps to be at 2 places?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants