Wiremock: Wiremock dependencies

Created on 21 Jul 2017  路  5Comments  路  Source: tomakehurst/wiremock

Wiremock depends on some libraries (sevlet-api, jetty, ...). In legacy projects, sometimes there is already an other version of the library or an transitive dependency or ...

Actually, we solve this by starting a docker container with wiremock and configuring stubs via JSON API. This is ok, but if we could use the fluent api, it would be great.

Anyway, there are plans to modularize wiremock into client (less dependencies) and server?

Feature request

Most helpful comment

Right, got it. Agree the servlet API dependency is a pain.

I've been mulling over a couple of ideas to help with this for a while. A lightweight client is one, and this would benefit the Android community too (due to size/method limit issues) so I'll mark this as a feature request.

The other option I've been considering is just removing the servlet API as a dependency completely (probably publishing a separate JAR that adds it back for compatibility). The main issue with this is that WireMock uses a number of filters and servlets that would need to be re-written, so it's not a small job.

All 5 comments

Have you tried using the standalone jar as a dependency? This shades basically everything except the servlet api (which would break Jetty unfortunately).

Yes, but then we have to use an older version of wiremock that fits our servlet-api dependency.

Right, got it. Agree the servlet API dependency is a pain.

I've been mulling over a couple of ideas to help with this for a while. A lightweight client is one, and this would benefit the Android community too (due to size/method limit issues) so I'll mark this as a feature request.

The other option I've been considering is just removing the servlet API as a dependency completely (probably publishing a separate JAR that adds it back for compatibility). The main issue with this is that WireMock uses a number of filters and servlets that would need to be re-written, so it's not a small job.

A smaller footprint would be very compelling on Android, but the Apache libraries (while large) provide so much for free. It's a lot of extra work to try to squeeze some of those out.

In Spring Cloud Contract we use Wiremock without all the 3rd party dependencies. It's already quite independent of everything except the servlet API (once #728 is fixed anyway, which was a regression). If you have a Spring Boot app then spring-cloud-contract-wiremock is already the best choice, but if not you can use or copy the dependency management from there (where we exclude the poisonous stuff in Wiremock).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karolzmuda picture karolzmuda  路  5Comments

rugden picture rugden  路  3Comments

samdnz picture samdnz  路  3Comments

flyinfish picture flyinfish  路  3Comments

jaina00 picture jaina00  路  4Comments