karate-pom.json paths are executed twice - every feature runs 2x (2.1.2 standalone)
Summary
When karate-pom.json contains a paths entry, karate run (with no positional paths) executes every feature twice. The duplication also happens when running the fatjar directly with java -jar, so this appears to be in the jar's pom handling, not in the karate CLI launcher.
Environment
- Karate 2.1.2 (standalone fatjar from GitHub Releases)
- Temurin JRE 21 (eclipse-temurin:21-jre), Linux arm64 container
- Launcher: karate-cli v0.1.7 (but reproduces without it, see below)
Minimal reproduction
Directory layout (no HTTP, no karate-config.js needed):
repro/
├── karate-pom.json
└── features/
└── minimal.featurekarate-pom.json:
{
"paths": ["features"]
}features/minimal.feature:
Feature: minimal
Scenario: one
* def x = 1
* match x == 11. karate run (pom picked up automatically) — feature runs twice
$ karate run
scenarios: 1 | passed: 1 | passed | time: 0.1720
scenarios: 1 | passed: 1 | passed | time: 0.0010
features: 2 | passed: 2 | all passed
scenarios: 2 | passed: 2 | all passedOne physical feature file is reported as features: 2 and executed twice.
2. karate run --no-pom features — runs once (expected behavior)
$ karate run --no-pom features
features: 1 | passed: 1 | all passed
scenarios: 1 | passed: 1 | all passed3. Bypassing the CLI launcher — still twice
$ java -jar karate-2.1.2.jar run
features: 2 | passed: 2 | all passed
scenarios: 2 | passed: 2 | all passedSame doubling without karate-cli in the picture, so the launcher is not the cause.
Expected
With paths: ["features"] in karate-pom.json and no positional paths, each feature should run exactly once.
Observed
Every feature under the pom's paths runs exactly twice (13 real-suite scenarios become 26; the minimal case above shows 1 → 2). It looks like the pom's paths are appended to the run twice.
Impact / workaround
Doubled suite runtime, and misleading totals in reports. Workaround we use: don't ship a karate-pom.json and pass paths explicitly (equivalent to --no-pom).
Source: karatelabs/karate