Class KarateOptionsHandler

java.lang.Object
io.karatelabs.core.KarateOptionsHandler

public final class KarateOptionsHandler extends Object
Applies system-property and environment-variable overrides to a Runner.Builder at the start of parallel(). This preserves the v1 "CI override" contract where Maven/Gradle users pass -Dkarate.options="--tags @smoke" to override a Runner class's hard-coded values without a code change.

Precedence (highest first):

  1. -Dkarate.options="..." system property
  2. KARATE_OPTIONS environment variable (fallback)
  3. Individual sysprops: karate.env, karate.config.dir, with env var fallbacks (KARATE_ENV, KARATE_CONFIG_DIR)
  4. Builder values set programmatically
  5. karate-pom.json values (applied upstream by RunCommand)
  6. Defaults

Implementation reads each override and applies it via the Builder's package-private setters, reusing the v2 CLI grammar through CommandLine.populateCommand(T, java.lang.String...) on a RunCommand instance.