gitlab4j-api
gitlab4j-api copied to clipboard
Dependency convergence error for jakarta.activation:jakarta.activation-api and jakarta.xml.bind:jakarta.xml.bind-api
Maven build fails due to dependency convergence error. If I include these dependencies in exclusion category, then the Duplicate Class rule breaks, Where the duplicate classes are from aopallianace from guice dependency, and aopalliance-repackaged from org.glassfish.hk2.external.
Attached is the error I get, can someone suggest what can be done. Thanks. error.txt
I guess if you enforce usage of jakarta.activation:jakarta.activation-api:1.2.1 (instead of 1.2.2) then your issue is solved?
~Personally I think gitlab4j-api should not declare a dependency to jakarta.activation:jakarta.activation-api since this is already a dependency of the jersey client we are using.~
It seems that with the newest jersey version, there is no dependency on jakarta.activation-api anymore. So the one gitlab4j indicates as dependency will not conflict with anything else.
I tried enforcing usage of jakarta.activation:jakarta.activation-api:1.2.1, but my hibernate dependency creates a conflict. I am using maven rule of banning duplicate class in my parent pom. It creates this issue with hibernate, guice - aopalliance etc. Hibernate also uses this dependency with version 1.2.0, and I can't risk tinkering with hibernate. You can refer here
Also, I tried using the latest 6.0.0-rc.1 release, which gives me another error: Required Upper Bound Dependency error. You can refer here
And if you pin the version to of jakarta.activation:jakarta.activation-api to 1.2.0 (the one hibernate is using?). I think gitlab4j-api does not really care about the version. It just need one to avoid the error:
May 10, 2023 1:31:00 PM org.glassfish.jersey.message.internal.MessagingBinders$EnabledProvidersBinder bindToBinder
WARNING: A class javax.activation.DataSource for a default provider MessageBodyWriter<javax.activation.DataSource> was not found. The provider is not available.
6.0.0-rc.1 is a complete different story, because we are using the lib (jersey client and so on) in the version that uses the jackarta.* packages instead of javax.*. This version is intended to be used with Spring 6, Spring Boot 3, Quarkus 3 and all the other frameworks that are using this namespace.