Skip to content

1.2.0 Upgrade Guide

Peter Thomas edited this page May 9, 2022 · 13 revisions

There are only 2 breaking changes you need to watch out for.

karate-core is no longer a "fat jar"

For a while, Karate has been using the Maven Shade plugin to bundle a few dependencies within the karate-core artifact. This was to reduce the likelihood of Karate dependencies "colliding" with other dependencies when you add Karate to an existing Maven or Gradle project that has a lot of other dependencies. For example a lot of Java projects directly or indirectly depend on Netty and Thymeleaf.

Now karate-core will no longer "bundle" dependencies and be a normal "thin" Maven dependency. It will transitively pull in the other libraries Karate depends on. The reason for this change is partly due to security considerations, read this for more details.

If you want to get the old "fatjar" experience back, we now publish an additional artifact with the all classifier.

This may not impact most projects, but if you face issues such as "class not found", just add <classifier>all</classifier> in your pom.xml (or build.gradle).

Before

<dependency>
  <groupId>com.intuit.karate</groupId>
  <artifactId>karate-core</artifactId>
  <version>${karate.version}</version>
</dependency>

After

<dependency>
  <groupId>com.intuit.karate</groupId>
  <artifactId>karate-core</artifactId>
  <version>${karate.version}</version>
  <classifier>all</classifier>
</dependency>

Karate Mocks: requestUri now starts with a forward-slash

This is also rarely used, but if you were using the "magic variable" called requestUri like this:

Scenario: requestUri.startsWith('hello/')

That should now be:

Scenario: requestUri.startsWith('/hello/')