maruTA-bis5 / mattermost4j

Mattermost API v4 Client for Java
Apache License 2.0
31 stars 20 forks source link

Jakarta-less dependency for 3rd party usage in frameworks ? #505

Closed laurentperez closed 1 year ago

laurentperez commented 1 year ago

Hello

This is not a bug, more a question. This is probably related to https://github.com/maruTA-bis5/mattermost4j/issues/308

Under Quarkus framework, client construction throws (1) This is because jersey 3.0.4 wants import jakarta.inject.Singleton; I opened https://github.com/quarkusio/quarkus/issues/30069 on their side.

Quarkus uses (at the moment) javax. and RESTeasy.

Do you know if there is a way to force a dependency of jersey<3.0.4 to keep the javax. compatibility ? Thanks !

(1)

2022-12-24 16:43:44,900 ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (executor-thread-0) Request failed: java.lang.NoClassDefFoundError: jakarta/inject/Singleton
    at org.glassfish.jersey.model.ContractProvider$Builder.<clinit>(ContractProvider.java:67)
    (...)
    at org.glassfish.jersey.client.JerseyClientBuilder.register(JerseyClientBuilder.java:244)
    at org.glassfish.jersey.client.JerseyClientBuilder.register(JerseyClientBuilder.java:48)
    at net.bis5.mattermost.client4.MattermostClient.buildClient(MattermostClient.java:201)
laurentperez commented 1 year ago

solved this by https://github.com/quarkusio/quarkus/issues/30069#issuecomment-1364730702

the #308 plan is indeed a good idea tho. @maruTA-bis5 feel free to close my issue, however it does not directly relate to Jersey or RESTeasy, it's more about the jakarta EE migration.

maruTA-bis5 commented 1 year ago

Hi @laurentperez I've just released version 1.0.0-beta.1 includes #308 changes.
Please add mattermost4j-resteasy dependency to your project then you can use RESTEasy as a client under the Quarkus framework afaik.

(*) Version 1.0.0-beta.1 will be available by Maven Central Repository within 2-3 hours.

If you are facing any problems, feel free to open a new issue.