Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken [dependency management model] #70

Open
YuriiChukhrai opened this issue Apr 13, 2023 · 0 comments
Open

Broken [dependency management model] #70

YuriiChukhrai opened this issue Apr 13, 2023 · 0 comments

Comments

@YuriiChukhrai
Copy link
Contributor

I am guessing you uploaded the uber/fat jar to the Maven central.
In that case the supplier of you framework/dependency is not able to exclude some dependency (transitive) that can came from your repo.
And regular maven mechanism to exclude dependencies does not work, and is required to implement some work around (re-pack your artifact and delete some classes)

This approach does not work with the uber/fat jar:

   <dependency>
      <groupId>com.google.pdsl</groupId>
      <artifactId>pdsl</artifactId>
      <version>${pdsl.version}</version>
      <exclusions>

        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>

        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
        </exclusion>

        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-core</artifactId>
        </exclusion>

        <exclusion>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
        </exclusion>

        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>

        <exclusion>
          <groupId>org.sonatype.sisu</groupId>
          <artifactId>sisu-guice</artifactId>
        </exclusion>

      </exclusions>
    </dependency>

Maven documentation:
Dependency management - this allows project authors to directly specify the versions of artifacts to be used when they are encountered in transitive dependencies or in dependencies where no version has been specified. In the example in the preceding section a dependency was directly added to A even though it is not directly used by A. Instead, A can include D as a dependency in its dependencyManagement section and directly control which version of D is used when, or if, it is ever referenced.

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

No branches or pull requests

1 participant