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

3.0.0-M1 JSON-B #159

Closed
1 of 4 tasks
Tracked by #157
fabapp2 opened this issue Jun 13, 2022 · 10 comments · Fixed by #265
Closed
1 of 4 tasks
Tracked by #157

3.0.0-M1 JSON-B #159

fabapp2 opened this issue Jun 13, 2022 · 10 comments · Fixed by #265
Labels
3.0.0 Spring Boot 3.0.0 good first issue Good for newcomers type: enhancement New feature or request

Comments

@fabapp2
Copy link
Contributor

fabapp2 commented Jun 13, 2022

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M1-Release-Notes#json-b

What needs to be done

Dependency management for Apache Johnzon has been removed in favor of Eclipse Yasson. A Jakarta EE 9-compatible version of Apache Johnzon can be used with Spring Boot 3, but you will now have to specify a version in your dependency declaration.

if dependency to Johnzon found on classpath...

  1. if the version is managed by Spring Boot
    1.1 replace it with org.apache.johnzon:johnzon-core:1.2.18:jakarta
    2 if the version is NOT managed by Spring Boot (declared)
    2.1 replace it with org.apache.johnzon:johnzon-core:1.2.18:jakarta
  • Implement an Action with the described steps
  • Write a test using TestProjectContext for this Action
  • Find out what 'compatible' means, which version of Johnzon is used in Boot 2.7 and for which version of Johnzon a new Jakarta Compatible version exists
  • Implement the replacement
@fabapp2 fabapp2 added Boot/Upgrade 3.0.0 Spring Boot 3.0.0 labels Jun 13, 2022
@fabapp2 fabapp2 added this to the Spring Boot Upgrade 3.0 (M3) milestone Jun 13, 2022
@fabapp2 fabapp2 changed the title Spring Boot 3.0.0-M1 JSON-B 3.0.0-M1 JSON-B Jun 13, 2022
@ravig-kant
Copy link
Contributor

Hi @fabapp2

What is the expected solution for this change? Is SBM suppose to add "Jakarta EE 9-compatible version of Apache Johnzon" in build files?

Ravi

@fabapp2
Copy link
Contributor Author

fabapp2 commented Jul 13, 2022

Hi @ravig-kant !
Thanks for asking.
I updated the description with how I understand this change.
If we could just blindly replace the dependency it would be a declarative recipe in OpenRewrite syntax.
But if we want to cover edgy cases it can be a recipe in SBM.
If you want, you can pick this issue?

@fabapp2
Copy link
Contributor Author

fabapp2 commented Jul 13, 2022

Hi @ravig-kant,
#158 is another issue that you could pick if you like.

@fabapp2 fabapp2 added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 14, 2022
@ravig-kant
Copy link
Contributor

Thanks for the explanation @fabapp2. I will work on this one.

@ravig-kant
Copy link
Contributor

ravig-kant commented Jul 17, 2022

Hi @fabapp2

As of today, Apache Johnzon supports JSON-B 1.0 specifications while JakarataEE 9.0 requires JSON-B 2.0. So, shall I raise an exception if the recipe detects an explicit dependency on Apache Johnzon?

https://johnzon.apache.org/download.html

Thanks
Ravi

@fabapp2
Copy link
Contributor Author

fabapp2 commented Jul 19, 2022

Hi @ravig-kant

Thanks for looking into it. I can follow you and can't see which version of Johnzon should be used in place of Yasson.
I will bring it back to the team.

For reference:
Spring Boot 3.0.0-M3 manages yasson:2.0.4 (JEE 9)
Spring Boot 2.7.x manages johnzon:1.2.18 (JEE 8)

For now, I think this should become a precondition check in #237. Not sure about your current state but throwing an exception would work for now (and get it merged). As soon as we start working on #237 we can see how to integrate it there?

@fabapp2 fabapp2 removed the help wanted Extra attention is needed label Jul 19, 2022
@fabapp2
Copy link
Contributor Author

fabapp2 commented Jul 19, 2022

Hi @ravig-kant
The Johnzon replacement for Yasson 2.0.4 is

<dependency>
        <groupId>org.apache.johnzon</groupId>
        <artifactId>johnzon-core</artifactId>
        <version>1.2.18</version>
        <classifier>jakarta</classifier>
</dependency>

@ravig-kant
Copy link
Contributor

Thanks, @fabapp2

I will start fixing.

ravig-kant pushed a commit to ravig-kant/spring-boot-migrator that referenced this issue Jul 27, 2022
@ravig-kant
Copy link
Contributor

Hi @fabapp2

PR raised.

Ravi

fabapp2 pushed a commit that referenced this issue Aug 3, 2022
…n 2.7 t… (#265)

Co-authored-by: Ravi Gupta <ravikant.gupta@salesforce.com>
fabapp2 pushed a commit that referenced this issue Aug 9, 2022
…n 2.7 t… (#265)

Co-authored-by: Ravi Gupta <ravikant.gupta@salesforce.com>
@fabapp2 fabapp2 added the type: enhancement New feature or request label Sep 21, 2022
@tkvangorder
Copy link

FYI, we have included a recipe in rewrite-migrate-java to make the appropriate changes to johnzon dependencies in maven:

openrewrite/rewrite-migrate-java#139

This was referenced Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0.0 Spring Boot 3.0.0 good first issue Good for newcomers type: enhancement New feature or request
Projects
None yet
3 participants