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

Make server-side components use only Jakarta EE #7837

Merged
merged 5 commits into from
Dec 14, 2023

Conversation

snazy
Copy link
Member

@snazy snazy commented Dec 13, 2023

In the past we allowed using either Java 8 or 11+ to test Nessie services. Some time ago, Nessie started to require Java 11 for all services. This change is a consequence of the former two changes and removes dependencies to javax.* (Java EE), favoring jakarta.* (Jakarta EE).

Most code changes are pretty boring:

  • Remove javax.* annotations
  • Remove dependencies from the build scripts
  • JerseyServer in the compatibility tests has the only "real" code change

In the past we allowed using either Java 8 or 11+ to test Nessie services. Some time ago, Nessie started to require Java 11 for all services. This change is a consequence of the former two changes and removes dependencies to `javax.*` (Java EE), favoring `jakarta.*` (Jakarta EE).

Most code changes are pretty boring:
* Remove `javax.*` annotations
* Remove dependencies from the build scripts
* `JerseyServer` in the compatibility tests has the only "real" code change
@@ -172,20 +174,24 @@ private static void withClass(

private static void withJavaxClass(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are moving towards jakarta and eventually javax will go away, it would be easier to understand if we inverted the logic:

withJakartaClass(
    "org.projectnessie.services.restjakarta.ContentKeyParamConverterProvider",
    config::register,
    true);

private static void withJakartaClass(
    String jakartaClassName, Consumer<Class<?>> whenClassExists, boolean mandatory) {
  Iterator<String> classNames =
      List.of(jakartaClassName, jakartaClassName.replace("restjakarta.", "restjavax."))
          .iterator();
// ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we need this replacement: javaxClassName.replace("restjavax.", "rest.") ? I removed it, and the build passed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some older Nessie versions required it (a while ago). Maybe no longer needed.

@snazy snazy merged commit 209758f into projectnessie:main Dec 14, 2023
16 of 17 checks passed
@snazy snazy deleted the server-jakarta-ee branch December 14, 2023 15:30
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.

None yet

3 participants