Skip to content

[BUG] Result JAR file should not contain slf4j classesΒ #1020

@semyon-levin-workato

Description

@semyon-levin-workato

Describe the bug
Currently, the result JAR file contains slf4j classes (org/slf4j/**). These classes are not relocated but they will conflict with slf4j-api dependency this dependency is used in a project.

The result POM file of databricks-jdbc already contains als4j-api dependency. So, there is no need to include slf4j classes in the result JAR.

To Reproduce

  1. Create a project with databricks-jdbc and slf4j-api dependencies are added.
  2. Both of the artifacts will have org/slf4j/** classes.
  3. If the code relies on a particular slf4j-api version, the behavior will depend on the order of dependencies.

Expected behavior
databricks-jdbc JAR doesn't contain org/slf4j/** classes.

Proposed fix
Add the following to the configuration of maven-shade-plugin:

<artifactSet>
  <excludes>
    <exclude>org.slf4j:slf4j-api</exclude>
  </excludes>
</artifactSet>

I tried to build it locally and looks like this is also required:

<filters>
  <filter>
    <artifact>*:*</artifact>
    <excludes>
      <exclude>org/slf4j/**</exclude>
    </excludes>
  </filter>
</filters>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions