WireMock Java is distributed in two flavours - a standard JAR containing just WireMock, and a standalone uber JAR containing WireMock plus all its dependencies.
Most of the standalone JAR’s dependencies are shaded i.e. they are hidden in alternative packages. This allows WireMock to be used in projects with conflicting versions of its dependencies. The standalone JAR is also runnable (see Running as a Standalone Process).
Add the following to your project's pom.xml dependencies:
Then follow the next steps for JUnit 5+ or plain Java.
Add the following to your project's build.gradle:
Then follow the next steps for JUnit 5+ or plain Java.
Add the following to your project's build.gradle.kts:
Then follow the next steps for JUnit 5+ or plain Java.
Add the following to your project’s build.sbt:
Download the latest standalone JAR then run the following in a terminal:
Learn more in the running standalone guide.
Run the following in a terminal:
Learn more in the Docker guide.
Run the following in a terminal:
docker run -it --rm -p 8080:8080 --name wiremock \
wiremock/wiremock:3.4.2
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>3.4.2</version>
<scope>test</scope>
</dependency>
testImplementation "org.wiremock:wiremock-standalone:3.4.2"
Learn more in the Docker guide.
If you want to run WireMock as a standalone process you can download the standalone JAR from here