adamyork / wiremock-velocity-transformer

extension for rendering velocity templates for stubbed responses.
MIT License
11 stars 6 forks source link

Change the import order of jar files in -cp option #1

Closed 4lberto closed 7 years ago

4lberto commented 7 years ago

Changed the order in the import of jars because in the old way, wiremock is not accepting some parameters such as --global-response-templating to use handlebars besides the velocity extension. Specifying first the wiremock-standalone jar does the trick because it takes the last version of WireMockServerRunner and not the probably old one contained in the wiremock-velocity-transformer-standalone-1.4.jar version.

In this way I could execute this command with no problems at all: java -cp "wiremock-standalone-2.5.0.jar:wiremock-velocity-transformer-standalone-1.4.jar" com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --global-response-templating --extensions com.github.adamyork.wiremock.transformer.VelocityResponseTransformer --verbose

adamyork commented 7 years ago

I see. So the issue is you want to use a newer version of wiremock standalone with this version of velocity transformer standalone. The reason this works most likely has to do with the class loader using the first instance of the class that is contained within both far jars. While this may fix your particular issue, there may be unintended side effect by using a much newer version of wiremock with this. At any rate, I'll merge this PR. Thanks for the contribution.