wiremock icon indicating copy to clipboard operation
wiremock copied to clipboard

Update Jetty Dependency to Version 12.0.3

Open gderemetz opened this issue 1 year ago • 13 comments

Proposal

Hello,

since version 3.2.0 of Spring Boot, it includes Jetty-BOM version 12.0.3.

Unfortunately, this version is not supported by WireMock (uses Jetty version 11.0.18) , and as a result, I am unable to upgrade the Spring Boot version. I encounter errors during unit tests, specifically:

java.lang.IncompatibleClassChangeError: class org.eclipse.jetty.http2.server.HttpChannelOverHTTP2 has interface org.eclipse.jetty.server.HttpChannel as super class.

Is it planned for WireMock to use the latest version of Jetty?

Sincerely

References

No response

gderemetz avatar Nov 30 '23 15:11 gderemetz

me also facing the same issue @gderemetz

azeem87 avatar Dec 01 '23 11:12 azeem87

I'm also facing the same problem

pzgadzaj-equinix avatar Dec 01 '23 22:12 pzgadzaj-equinix

We too face this issue

dimovelev avatar Dec 04 '23 09:12 dimovelev

The update is not trivial in this case.

Jetty 12 was split into submodules for Java/Jakarta EE 8, 9 and 10 with different Java packages which has potential for conflicts in different environments. [1]

The conflicting modules in the SB 3.2 scenario are jetty-servlet(s). Trivial exclude and pulling in jetty-ee10-servlet(s) instead doesn't work, because org.eclipse.jetty.servlet.* now lives in org.eclipse.jetty.ee10.servlet.* and so on...

Should be possible to migrate this without too much noise, but most likely breaking some things, at least Java 11 support.

Simply downgrading jetty.version to 11.x (theoretically possible, if the application itself does not actually use Jetty) is not an option, because the imported jetty-ee10-bom does not exist in that version.


[1] https://eclipse.dev/jetty/documentation/jetty-12/programming-guide/index.html#pg-migration-11-to-12

stklcode avatar Dec 05 '23 17:12 stklcode

I tried downgrading jetty version l, still didn't work

azeem87 avatar Dec 05 '23 19:12 azeem87

Please look into https://github.com/wiremock/wiremock/issues/2149. There is description for the possible solutions.

marcindabrowski avatar Dec 06 '23 09:12 marcindabrowski

It is also described here: #2395

GregoireW avatar Dec 06 '23 09:12 GregoireW

@marcindabrowski after adding below dep, was able to upgrade spring boot 3.2.0

<dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-bom</artifactId> <version>11.0.18</version> <type>pom</type> <scope>import</scope> </dependency> Thanks for your help.

I hope jetty upgrade will happen soon in wiremock :)

azeem87 avatar Dec 07 '23 06:12 azeem87

Just for the record, this may cause interesting issues, if you actually use Jetty components in your application outside of Wiremock. If this is the case, carefully check your dependency tree to avoid mixed versions (both jetty-bom 11.x and jetty-ee10-bom 12.x are imported). If this is not the case, this workaround is totally fine.

stklcode avatar Dec 07 '23 08:12 stklcode

@stklcode Yes you are right. it may cause issues. for us jetty is a transitive dependency and used only by wiremock in test env.

azeem87 avatar Dec 07 '23 10:12 azeem87

I encountered a similar issue when using the following dependency:

<dependency>
    <groupId>org.wiremock</groupId>
    <artifactId>wiremock</artifactId>
    <version>3.3.1</version>
    <scope>test</scope>
</dependency>

Afterward, I resolved the issue by updating the dependency to:

<dependency>
    <groupId>org.wiremock</groupId>
    <artifactId>wiremock-standalone</artifactId>
    <version>3.3.1</version>
    <scope>test</scope>
</dependency>

This helped me too

<dependency>
    <groupId>org.wiremock</groupId>
    <artifactId>wiremock-standalone</artifactId>
    <version>3.3.1</version>
    <scope>test</scope>
</dependency>

Thank you @bhagyashree-marekar-polestar

anilogutveren avatar Jan 30 '24 10:01 anilogutveren