1

I am trying to use Karate Mock Server to replace my Wiremock server to mock API calls. Since I need to start Karate as a server, I am wondering what are the minimum maven dependencies I need to start the karate server? Do I just need Karate Netty and Karate Core or do I need the full karate (50MB) jar? Can someone please share the maven dependency for this?

1 Answers1

0

Minimum maven dependencies: just one dependency, karate-core.

Please look at the latest version. There is no karate-netty it was rolled into karate-core a while ago.

The "fatjar" is convenient for teams to use without worrying about Maven or Gradle. Front-end teams or JS devs like it. Please refer to this page: https://github.com/karatelabs/karate/wiki/ZIP-Release

The rest of your questions are answered in the docs: https://github.com/karatelabs/karate/tree/master/karate-netty - again, make sure you are on the latest version.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • I apologize for this trivial question, but when I do "java -jar karate-core-1.2.0.RC4.jar -m simple.feature -p 8080" from the command line I get an error for ClassNotFoundException: org.slf4j.LoggerFactory. Here are the contents of my simple.feature file: Feature: Scenario: pathMatches('/hello') * def response = 'hello world' With the "fatjar" it works absolutely fine. – ContinuousLearner Mar 29 '22 at 18:34
  • yeah only the "fatjar" works like that on the command-line. so please use the "correct" jar. – Peter Thomas Mar 29 '22 at 19:25
  • 1
    I was able to bring up the mock server with just karate-core as compile time dependency, Since I do not tear-down the mock server after my tests are completed. I will change the scope to test once my tests are stable. – ContinuousLearner Apr 12 '22 at 15:55