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

Jakarta namespace and Guice 7 #576

Merged
merged 3 commits into from
Sep 21, 2023
Merged

Conversation

sgdesmet
Copy link
Contributor

Switch to jakarta.* namespaces and Guice 7 (#574).

Note that this is a breaking change as the javax.* namespaces are no longer supported.

Apache Aries was replaced with Agroal + Narayana JTA in the unit tests, as it does not support the jakarta namespace.

@hazendaz
Copy link
Member

@sgdesmet Please replace * import usage with direct imports. Also, can you tell me what happened to version 6 of guice? Was that for EE9?

For releasing, I'll do one prior to jakartaEE here so its up to date but then will do this after.

@hazendaz hazendaz self-assigned this Aug 15, 2023
@sgdesmet
Copy link
Contributor Author

@hazendaz sure, I've removed the wildcard imports. With regards to Guice 6, this was released together with version 7, and is intended as a transition package and as such only partially supports the jakarta namespace :

Guice 6.0 is being released alongside Guice 7.0 and is intended to help users migrate their code to the jakarta namespace. Guice 6.0 continues to fully support the javax.inject namespace while also mostly supporting the jakarta.inject namespace. The only part of Guice 6.0 that doesn't support jakarta.inject are the bind(..).toProvider methods. Those methods still require javax.inject or com.google.inject Providers.

The Guice 6.0 servlet & persist extensions only support the javax.servlet and javax.persistence namespaces respectively. If compatibility with jakarta.servlet or jakarta.persistence is required, use Guice 7.0.

@Sergey-Stepin
Copy link

Sergey-Stepin commented Sep 21, 2023

I currently have a project that depends on Google Guice (5.1.0) and org.mybatis:mybatis:3.5.13 Now I have to update Google Guice to 7.0.0 which uses jakarta instead of javax. That, though, makes it incompatible with MyBatis.

I have used this pull-request and built 3.19-SNAPSHOT locally.
The only caveat for me was that mybatis-guice lacks of some packages we use, like org.apache.ibatis.* Therefore, in order to use the entire mybatis framework locally, I had to remove line provided from dependency declaration:

<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.13</version>
<scope>provided</scope>
</dependency>

The rest went smoothly and the application compiled successfully. Unfortunately, I cannot test the whole application, because there are some other incompatibility with other libraries that appear at runtime. But for now, I do not see any problems with MyBatis.

@christianpoitras christianpoitras merged commit f1fa3d3 into mybatis:master Sep 21, 2023
14 checks passed
@sgdesmet sgdesmet deleted the feat/guice7 branch September 25, 2023 12:40
@hazendaz
Copy link
Member

hazendaz commented Nov 4, 2023

@sgdesmet I hope to get this released in next week here officially.

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