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

Bump guice to 7.0 and replace deprecated javax inject with jakarta inject #1441

Open
wants to merge 1 commit into
base: 2.6
Choose a base branch
from

Conversation

notz
Copy link

@notz notz commented Jan 17, 2025

https://github.com/google/guice/wiki/Guice700

The aim

With java 9 the javax.* namespace moved to jakarta.* (https://jakarta.ee/blogs/javax-jakartaee-namespace-ecosystem-progress/).
Since restlet minimum java version is now 17, we should also move to jakarta.*

The solution

Replace javax.* with jakarta.* and bump guice to 7.0.0

@notz notz changed the title Bump guice to 7.0 Replace deprecated javax inject with jakarta inject Bump guice to 7.0 and replace deprecated javax inject with jakarta inject Jan 17, 2025
@Tembrel
Copy link
Collaborator

Tembrel commented Jan 17, 2025

Note that this might break the org.restlet.ext.guice extension, which depends on javax.inject. (I am the author of that extension.) It could be that simply replacing javax.inject with jakarta.inject, as has been done here, will work, but I have no way of testing that, since I am stuck on Restlet 2.5 and Java 8 for the foreseeable future, for narrow technical reasons.

I have indicated elsewhere that I would be fine with removing the "Guice" extension entirely in 2.6, since I think the very small amount of code needed to make ServerResources injectable doesn't warrant an entire extension.

But some people might reasonably expect to continue using it. 😉

@jlouvel
Copy link
Member

jlouvel commented Jan 18, 2025

Thanks @notz Have you been able to test the code to ensure it is working as @Tembrel isn't able to do so? Also, could you send us the signed JCA? See document in wiki. https://github.com/restlet/restlet-framework-java/wiki/Contribute

@Tembrel I think we should deprecate the Guice extension in 2.6 for removal in 2.7 per your guidance. We can always revisit this for version 3.0 and reconsider in 2.7 based on community feedback

@sblommers
Copy link

sblommers commented Jan 18, 2025

@Tembrel i already did this port of the guice extension earlier to guice 7.0 and it works perfectly
I did a part of the port the team is doing now on 2.6 earlier and we are running on acceptance for a while now without any problems; Java 21, Jetty 12, GWT 2.12.1, jakarta.*, Guice 7.0.0

@notz
Copy link
Author

notz commented Jan 18, 2025

@jlouvel We use that changes, along with Java 21 and Guice 7.0.0, also for some time now.

But it's ok for use to remove the extension. Since it's really very simple. I think, I have already signed the jca a long time ago, but it's no problem to do it again. Where should I send the signed jca?

@jlouvel
Copy link
Member

jlouvel commented Jan 22, 2025

Thanks @notz for confirming the changes are working for you, please send it to [email protected].

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.

4 participants