Skip to content

Commit

Permalink
Updated README to clarify extension loading
Browse files Browse the repository at this point in the history
  • Loading branch information
tomakehurst committed Feb 26, 2024
1 parent f01880a commit 5538286
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ official one.

### Using extensions in CLI

For old style extensions (that don't have Java service loader metadata) you need to add the extension JAR file into the extensions directory and
specify the name of the extension's main class via the `--extensions` parameter:

```sh
# prepare extension folder
mkdir wiremock-docker/samples/random/extensions
Expand All @@ -182,6 +185,22 @@ docker run -it --rm \
--extensions com.opentable.extension.BodyTransformer
```

For new style extensions the `--extensions` part should not be included as the extension will be discovered and loaded automatically:

```sh
# prepare extension folder
mkdir wiremock-docker/samples/random/extensions
# download extension
wget https://repo1.maven.org/maven2/org/wiremock/wiremock-grpc-extension-standalone/0.5.0/wiremock-grpc-extension-standalone-0.5.0.jar \
-O wiremock-docker/samples/random/extensions/wiremock-grpc-extension-standalone-0.5.0.jar
# run a container using extension
docker run -it --rm \
-p 8080:8080 \
-v $PWD/wiremock-docker/samples/random/stubs:/home/wiremock \
-v $PWD/wiremock-docker/samples/random/extensions:/var/wiremock/extensions \
wiremock/wiremock
```

### Using extensions in the Dockerfile

```sh
Expand Down

0 comments on commit 5538286

Please sign in to comment.