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
Java 21 support #2149
Comments
The Gradle wrapper will also need to be updated to 8.4. |
Are there known issues ? It seems problematic to wait a year until after java 21 comes out for an official wiremock 4 support |
Doesn't seem compatible... works with JDK 17 but fails with JDK 21
Error I am getting:
those lines are as simple as:
|
@matiwinnetou are you sure that in your project you are not importing any bom file? For example I had the same error with Spring Boot 3.2 because in their bom there is Jetty 12, which is not compatible with Jetty 11 used by Wiremock. |
@marcindabrowski how did you end up excluding springboot jetty bom? I am facing the same issue |
thanks for that info @marcindabrowski i was able to resolve it, here is what i did, added the following segment to my pom.xml <dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-bom</artifactId>
<version>11.0.18</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement> This works, because, maven honors in the local pom.xml over the parent pom, or its parent. Note: I am using,
Documenting failure attempt, tried changing just the value of Please comment if there was a better resolution |
I'm using Gradle, and for me this helped: configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.eclipse.jetty") {
useVersion("11.0.18")
because("Jetty 12.x.x from Spring Boot 3.2.x is incompatible with Wiremock 3.3.x.")
}
}
} But it only works when you are importing Spring bom like this: implementation(platform("org.springframework.boot:spring-boot-dependencies:3.2.0")) If you are using ext["jetty.version"] = "11.0.18" So the only solution I found is to remove this plugin and import Spring Bom in Gradle way. |
These mentioned errors are not connected to Java 21 but to library mismatch (Jetty in WireMock and Spring Booot). <dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>3.3.1</version>
<scope>test</scope>
</dependency> This version shades all dependencies and you do not need to change anything. |
Proposal
Java 21 LTS is coming out soon, and it would be great to ensure that WireMock is fully compatible with it. WireMock may work out of the box, but we would still need official images, documentation, and CI runs against this baseline.
References
The text was updated successfully, but these errors were encountered: