Hello everyone, I'm working with `wiremock` as pa...
# help
s
Hello everyone, I'm working with
wiremock
as part of a Java/Spring Boot project, and when trying to upgrade to the latest version, we have found 2 different wiremock maven dependencies. So maybe you can help me understand the difference between
wiremock
and
wiremock-standalone
jars ? I have run
mvn dependency:tree
to see the differences: Having
wiremock-standalone
in pom.xml
[INFO] +- org.wiremock:wiremock-standalone:jar:3.3.1:test
Having `wiremock `in pom.xml :
Copy code
[INFO] +- org.wiremock:wiremock:jar:3.3.1:test
[INFO] |  +- org.eclipse.jetty:jetty-server:jar:11.0.18:test
[INFO] |  |  +- org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:jar:5.0.2:test
[INFO] |  |  +- org.eclipse.jetty:jetty-http:jar:11.0.18:test
[INFO] |  |  \- org.eclipse.jetty:jetty-io:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-servlet:jar:11.0.18:test
[INFO] |  |  \- org.eclipse.jetty:jetty-security:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-servlets:jar:11.0.18:test
[INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-webapp:jar:11.0.18:test
[INFO] |  |  \- org.eclipse.jetty:jetty-xml:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-proxy:jar:11.0.18:test
[INFO] |  |  \- org.eclipse.jetty:jetty-client:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty.http2:http2-server:jar:11.0.18:test
[INFO] |  |  \- org.eclipse.jetty.http2:http2-common:jar:11.0.18:test
[INFO] |  |     \- org.eclipse.jetty.http2:http2-hpack:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-server:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-java-server:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-java-client:jar:11.0.18:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-client:jar:11.0.18:test
[INFO] |  +- com.google.guava:guava:jar:32.1.3-jre:test
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:test
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:test
[INFO] |  |  +- org.checkerframework:checker-qual:jar:3.37.0:test
[INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.21.1:test
[INFO] |  |  \- com.google.j2objc:j2objc-annotations:jar:2.8:test
[INFO] |  +- org.apache.httpcomponents.client5:httpclient5:jar:5.2.1:test
[INFO] |  |  +- org.apache.httpcomponents.core5:httpcore5:jar:5.2:test
[INFO] |  |  \- org.apache.httpcomponents.core5:httpcore5-h2:jar:5.2:test
[INFO] |  +- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] |  |  \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] |  |     \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
[INFO] |  +- org.xmlunit:xmlunit-legacy:jar:2.9.1:test
[INFO] |  +- org.xmlunit:xmlunit-placeholders:jar:2.9.1:test
[INFO] |  +- net.javacrumbs.json-unit:json-unit-core:jar:2.38.0:test
[INFO] |  |  \- org.hamcrest:hamcrest-core:jar:2.2:test
[INFO] |  |     \- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.8.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.10:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.9:test
[INFO] |  +- org.ow2.asm:asm:jar:9.6:test
[INFO] |  +- net.sf.jopt-simple:jopt-simple:jar:5.0.4:test
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.13.0:test
[INFO] |  +- com.github.jknack:handlebars:jar:4.3.1:test
[INFO] |  +- com.github.jknack:handlebars-helpers:jar:4.3.1:test
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.5:test
[INFO] |  +- commons-io:commons-io:jar:2.15.0:test
[INFO] |  \- com.networknt:json-schema-validator:jar:1.0.87:test
[INFO] |     +- com.ethlo.time:itu:jar:1.7.0:test
[INFO] |     \- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.16.0:test
[INFO] |        \- org.yaml:snakeyaml:jar:2.2:test
When running my unit tests with
wiremock-standalone
, I don't get verbose logs, but when running them with with `wiremock `I get the following logs:
Copy code
[INFO] --- surefire:3.0.0-M3:test (default-test) @ *** ---
[INFO] Running ***
[main] INFO org.eclipse.jetty.server.Server - jetty-11.0.18; built: 2023-10-27T02:14:36.036Z; git: 5a9a771a9fbcb9d36993630850f612581b78c13f; jvm 11.0.21+9-LTS
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@6d7d0946{/__admin,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.handler.ContextHandler.ROOT - RequestHandlerClass from context returned com.github.tomakehurst.wiremock.http.StubRequestHandler. Normalized mapped under returned 'null'
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@3054cdd3{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started NetworkTrafficServerConnector@2fd409c1{HTTP/1.1, (http/1.1, h2c)}{0.0.0.0:39051}
[main] INFO org.eclipse.jetty.server.Server - Started Server@9fd5dd0{STARTING}[11.0.18,sto=1000] @10755ms
[main] INFO org.eclipse.jetty.server.Server - Stopped Server@9fd5dd0{STOPPING}[11.0.18,sto=1000]
[main] INFO org.eclipse.jetty.server.Server - Shutdown Server@9fd5dd0{STOPPING}[11.0.18,sto=1000]
[main] INFO org.eclipse.jetty.server.AbstractConnector - Stopped NetworkTrafficServerConnector@2fd409c1{HTTP/1.1, (http/1.1, h2c)}{0.0.0.0:0}
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@3054cdd3{/,null,STOPPED}
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@6d7d0946{/__admin,null,STOPPED}
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.178 s - in ***
And when adding Spring Boot BOM (just an example) I get errors when running my UT with
wiremock
, but no errors with
wiremock-standalone
Sample of errors with Spring boot BOM (2.7.18)
Copy code
java.lang.NoClassDefFoundError: jakarta/servlet/DispatcherType
Caused by: java.lang.ClassNotFoundException: jakarta.servlet.DispatcherType
Thank you!