wiremock
wiremock copied to clipboard
Update Jetty Dependency to Version 12.0.3
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
me also facing the same issue @gderemetz
I'm also facing the same problem
We too face this issue
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
I tried downgrading jetty version l, still didn't work
Please look into https://github.com/wiremock/wiremock/issues/2149. There is description for the possible solutions.
It is also described here: #2395
@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 :)
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 Yes you are right. it may cause issues. for us jetty is a transitive dependency and used only by wiremock in test env.
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