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

Migrate to Jakarta EE APIs #1510

Closed
thetric opened this issue Oct 21, 2021 · 26 comments
Closed

Migrate to Jakarta EE APIs #1510

thetric opened this issue Oct 21, 2021 · 26 comments
Assignees

Comments

@thetric
Copy link

thetric commented Oct 21, 2021

Hi there,

is there a roadmap to migrate rest-assured to Jakarta EE APIs? For example the Spring Framework is planning to migrate in the next year:

Spring Framework 6 and Spring Boot 3 are planned towards a high-end baseline for their general availability in Q4 2022:

  • Java 17+ (from Java 8-17 in the Spring Framework 5.3.x line)
  • Jakarta EE 9+ (from Java EE 7-8 in the Spring Framework 5.3.x line)

More information from the Eclipse Foundation: https://www.eclipse.org/community/eclipse_newsletter/2020/november/1.php

@lulseged
Copy link

Jakarta 9.0 is available now for a year and wonder when rest assured will meet jakataee 9 and java 17?

@holgerstolzenberg
Copy link

As the issue has been opened some days ago now - it would be great to hear something about the teams plans upon this topic.

We are using restassured everywhere on our platform currently in conjunction with Spring Boot 2. We are really looking forward on using Spring Boot 3, especially because of JDK-17 and the native stuff coming.

We are very pleased with restassured so far and would really like to stick with it.

@wilkinsona What consequences will we face if we upgrade to Spring Boot 3 without having restassured supporting the given APIs?

@wilkinsona
Copy link

That's really a question for the REST Assured team if you want a definitive answer. As far as I could tell, JAX-B is a required dependency and REST Assured fails fairly fundamentally if the javax.xml.bind classes from EE 8 aren't available.

Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 6, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8 [1].
See rest-assured/rest-assured#1510.
Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 6, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8 [1].
See rest-assured/rest-assured#1510.
Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 6, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8 [1].
See rest-assured/rest-assured#1510.
Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 6, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8 [1].
See rest-assured/rest-assured#1510.
Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 6, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 6, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 6, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
Ladicek added a commit to Ladicek/smallrye-context-propagation that referenced this issue Jan 7, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
manovotn pushed a commit to smallrye/smallrye-context-propagation that referenced this issue Jan 10, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
@johanhaleby johanhaleby self-assigned this Jan 17, 2022
@johanhaleby
Copy link
Collaborator

I'll look into this and see if I can make any progress.

@johanhaleby
Copy link
Collaborator

Can you still use Java 8 with the jakarta API?

@wilkinsona
Copy link

Yes. Jakarta EE 9 supports Java 8. 9.1 adds support for Java 11 while retaining support for Java 8.

@johanhaleby
Copy link
Collaborator

@wilkinsona And do you think it'll be fine to use Jakarta EE 9 for rest assured for the time being? Maybe I should drop support for Java 8 in the future, but I'd like to wait a bit longer if possible.

@wilkinsona
Copy link

Requiring Jakarta EE 9 at this point is a pretty big jump. We're heading in that direction for Spring but our releases that make the jump aren't due until the end of this year. Even once they're out, we'll continue to support EE 8 for quite some time as we're anticipating lots of users sticking with EE 8. In short – and I know this isn't going to be easy – I think supporting both EE 8 and EE 9 is going to be necessary across the ecosystem for the next 24-36 months.

To minimise that burden, I'd try to isolate yourself as much as possible from Jakarta EE and minimise your dependencies upon its APIs. Where you have to depend on it, try to make those dependencies optional. For example, if a REST API isn't doing anything with XML, perhaps REST Assured could avoid loading any JAX-B classes.

@lulseged
Copy link

Easier to keep 4.x.x in a separate maintenance branch for JAVA EE 8 and use a different branch(preferably master) for Jakarta 9.x.x.

@wilkinsona
Copy link

I'm not sure that doubling a project's maintenance burden is going to be easier, particularly when resources may be stretched pretty thin already.

@johanhaleby
Copy link
Collaborator

@wilkinsona Thank you for your explaination. I think that I'll try to make the dependency to jaxb optional.

@johanhaleby
Copy link
Collaborator

@wilkinsona Maybe you could clarify some more points and give me some additional tips if you don't mind? :) I'm in the process of making the JAXB dependency optional and I think that'll work. However, I have two questions:

  1. Is the "removal" (making it optional) of JAXB what's actually required for Spring Boot to work with REST Assured again?
  2. I'd like to add support for Jakarta EE 9 but, if I understand it correctly, Jakarta EE 8 and 9 have the same groupId and artifactId but different version numbers. Currently, in trunk, I have (optional) dependencies on version 2.3.x of jakarta.xml.bind:jakarta.xml.bind-api and org.glassfish.jaxb:jaxb-runtime (Jakarta EE 8). But I'd like to have version 3.x of these two libraries at the same time as an optional dependency in Maven. Is there a way to work around this that you're aware of?

@wilkinsona
Copy link

Is the "removal" (making it optional) of JAXB what's actually required for Spring Boot to work with REST Assured again?

I can't say for certain without being able to try it, but I would expect that for a large percentage of users this will be absolutely fine as they'll be working with JSON-based APIs and won't care about XML

Is there a way to work around this that you're aware of?

Different projects have been approaching this in different ways:

  1. Maintain one set of source code (typically using the javax.* APIs) and then use the Eclipse Transformer to generate classes that use the jakarta.* APIs automatically. Typically published as separate modules and users then need to select the right one. Hibernate has taken this approach.
  2. Use an older version of the javax APIs alongside the jakarta APIs in the same module and take advantage of the different group IDs. For JAX-B that would be javax.xml.bind:jaxb-api:2.3.1 and jakarta.xml.bind:jakarta.xml.bind-api:3.0.1. Thymeleaf has taken this approach.
  3. Maintain two separate source modules, one that uses the javax APIs and one that uses the jakarta APIs. Published as separate modules and users then need to select the right one.

I think 1 works well for a project, like Hibernate, that implements an EE API (JPA in this case). 2 seems to work well for a project that only consumes an EE API and may be a better fit for REST Assured, particularly if you can switch between javax JAX-B and Jakarta JAX-B at runtime depending on what's available on the classpath.

@johanhaleby
Copy link
Collaborator

@wilkinsona Thanks a lot for the clarification, this is really invaluable to me!

When it comes to question number 1, I was mainly asking from a spring-boot perspective. Because I think Spring Boot has removed rest-assured in version 3 if I'm not mistaken. My goal is to get it back :) But I wonder what I need to do in order to get it back as a managed dependency by spring boot 3? Is it enough to remove the explicit JAXB dependency, or is jakarta ee required, or/and is it something else? If you don't know, do you know who I should talk to?

@wilkinsona
Copy link

We removed REST Assured support due to the hard dependency on JAX-B from EE 8. Once REST Assured can be used in an EE 9 environment (even if that means there's no XML support), we'll be more than happy to reinstate support for it. The same goes for Spring REST Docs from which REST Assured support has also been temporarily removed for the same reasons.

@johanhaleby
Copy link
Collaborator

@wilkinsona That's great! I would like to try to add support for EE 9 as well. How much time do I have? :) If it's a hurry, maybe I can do a release today and just remove the dependencies to EE 8. Otherwise, I probably have more time on Friday to also introduce (optional) support for EE 9.

@wilkinsona
Copy link

There's plenty of time. While Spring Boot 3.0.0-M1 is scheduled for this Thursday, we're quite comfortable with releasing it without REST Assured support. We know that Jakarta EE 9 support across the ecosystem is going to take a while which is, in part, why we're having a longer development cycle for 3.0.0 (almost 12 months) and it won't GA until November 2022.

The dates for 3.0's milestones are on GitHub. They're every two months until M5 in September and then there's an RC in October before GA in November. That's the current plan anyway.

@johanhaleby
Copy link
Collaborator

@wilkinsona Thanks again for all your feedback and for responding so fast.

Unfortunatley I ran into an issue with Intellij (https://youtrack.jetbrains.com/issue/IDEA-286871) and currently I can't even compile REST Assured so I have to use Sublime which is suboptimal. But regardless of EE 9 or not, I still want to make a new release as soon as I can, it's long overdue.

@spencergibb
Copy link

Spring Cloud contract has a hard dependency. We release a week after boot, if that could be possible, we would appreciate it

@johanhaleby
Copy link
Collaborator

@spencergibb Thanks for letting me know! I'll try my very best to release a new version this friday!

@johanhaleby
Copy link
Collaborator

@spencergibb Or do you mean I should try to create a release sooner (before Thursday?)

@thetric
Copy link
Author

thetric commented Jan 18, 2022

@johanhaleby I did not encounter this problem with Maven 3.8.4, Java 8 (1.8.0_312 Amazon Corretto) when activating the following option to use Maven instead IntelliJ to build the project:

image

@spencergibb
Copy link

Friday is fine

@johanhaleby
Copy link
Collaborator

@thetric That works for me too! It's not optimal, but at least now I can work in Intellij. Thanks a lot!

@wilkinsona
Copy link

Thanks very much for this, @johanhaleby. I've reinstated support for REST Assured in Spring REST Docs and Spring Boot. It's available in their 3.0.0-SNAPSHOTs and will be in their 3.0.0-M2 releases in March.

@prdoyle
Copy link

prdoyle commented Feb 12, 2022

Just wanted to drop a note to thank you all for your efforts. Spring and REST Assured are both invaluable tools for us, and your efforts are greatly appreciated!

radcortez pushed a commit to smallrye/smallrye-context-propagation that referenced this issue Feb 14, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
radcortez pushed a commit to smallrye/smallrye-context-propagation that referenced this issue Feb 14, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
radcortez pushed a commit to smallrye/smallrye-context-propagation that referenced this issue Feb 14, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
radcortez pushed a commit to smallrye/smallrye-context-propagation that referenced this issue Sep 7, 2022
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
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

No branches or pull requests

7 participants