Skip to main content

System Properties

Theses are all the system properties used by Pact-JVM

  • Property - the key name of the system property.
  • Component - the Pact-JVM component the property is used with.
  • Values - the values that can be used for the property.
  • List - if the property can have a list of values (comma-separated).
  • ENV? - If the property can also be specified using an OS environment variable.
  • Up-case ENV? - Can upper case (screaming snake case) form be used for environment variables? (I.e for a.b.c you can use A_B_C environment variable).
PropertyComponentValuesListENV?Up-case ENV?Description
pact.content_type.override.<contentType>Matchingjson, text, binary, xmlnnnOverrides the handling of a particular content type. Ie., pact.content_type.override.applciation/thrift=json will force applciation/thrift content types to be treated as JSON. You can specify the content type as either type/subtype or type.subtype (e.g., pact.content_type.override.applciation/thrift=json or pact.content_type.override.applciation.thrift=json).
pact.matching.xml.validatingMatching (XML)true, falsennnWhen set to false, will disable XML schema validation when matching XML documents.
pact.matching.xml.namespace-awareMatching (XML)true, falsennnSetting this to true will enable support for XML namespaces with the XML parser.
pact.mockserver.addCloseHeaderMock servertrue, falsennnIf the mock server should add a Connection: close header to each response.
pact.writer.overwritePact IOtrue, falsennnSetting this to true will force the Pact file to always be overridden when written. Setting it to false will cause the Pact to be merged with any existing file.
pact.rootDirPact IODirectory namennnOverride the directory that Pact files are written to. The default behaviour is to try detect the build tool and set it appropriatly
pact.generators.packagesGeneratorsJava package namesynnSpecifies the Java packages to search when looking for generator classes.
pact.pactbroker.httpclient.usePreemptiveAuthenticationPact brokertrue, falsennnIf set to true, preemptive authentication will be used when accessing the Pact broker. This will send the Authorization header with every request. The default behaviour to to follow the HTTP RFC and only sent credentials after receiving a challenge response.
pact_do_not_trackAnalyticstrue, falsenynIf set to true, anonymous OS and JVM version metrics will not be sent to Google Analytics
pact.expressions.startExpressionsstring valuennnSets the string to use to detect the start of an expression. Default is ${.
pact.expressions.endExpressionsstring valuennnSets the string to use to detect the end of an expression. Default is }.
pact.consumer.tagsPublishing Pacts (Maven)string valueynnSets the consumer tags to use when publishing the Pact files.
pact.verifier.ignoreNoConsumersVerification (Gradle)true, falsennnDon't fail the verification task if no consumer Pacts are found to verify.
pactbroker.urlVerification (JUnit, JUnit 5)URLnynSet the Pact Broker URL to use to fetch pacts from.
pact (Deprecated)Verification (JUnit, JUnit 5)HostnamenynSet the Pact Broker hostname to use to fetch pacts from. Deprecated in favour of pactbroker.url
pact broker.port (Deprecated)Verification (JUnit, JUnit 5)Port numbernynSet the Pact Broker port to use to fetch pacts from. Deprecated in favour of pactbroker.url
pact broker.scheme (Deprecated)Verification (JUnit, JUnit 5)http, httpsnynSet the Pact Broker scheme to use to fetch pacts from. Deprecated in favour of pactbroker.url
pactbroker.tags (Deprecated)Verification (JUnit, JUnit 5)string valuesyynTags to use to fetch pacts for. Deprecated in favour of consumer version selectors.
pactbroker.consumerversionselectors.tagsVerification (JUnit, JUnit 5)tag namesyynTags to use with the selectors when fetching pacts to verify.
pactbroker.consumerversionselectors.latestVerification (JUnit, JUnit 5)true, falseyynIf for each tag to use with the selectors when fetching pacts to verify, should only the latest value be considered.
pactbroker.consumerversionselectors.rawjsonVerificationJSONnyyOverrides the consumer version selectors with raw JSON [4.1.29+/4.3.0+]
pactbroker.consumersVerification (JUnit, JUnit 5)consumer namesyynConsumer names to use with the selectors when fetching pacts to verify.
pactbroker.auth.usernameVerification (JUnit, JUnit 5)string valuenynUsername to use when fetching pacts to verify.
pactbroker.auth.passwordVerification (JUnit, JUnit 5)string valuenynPassword to use when fetching pacts to verify.
pactbroker.auth.tokenVerification (JUnit, JUnit 5)string valuenynBearer token to use when fetching pacts to verify.
pactbroker.enableInsecureTlsVerification (JUnit, JUnit 5)true, falsenynEnabling insecure TLS by setting this to true will disable hostname validation and trust all certificates. Use with caution.
pactbroker.enablePendingVerification (JUnit, JUnit 5)true, falsenynIf the pending pacts feature should be enabled when fetching pacts to verify. When this is set to true, the provider tags or provider branches property also needs to be set (pactbroker.providerTags or pactbroker.providerBranch).
pactbroker.providerTagsVerification (JUnit, JUnit 5)tag namesyynProvider Tags to use to evaluate pending pacts when fetching pacts to verify.
pactbroker.providerBranchVerification (JUnit, JUnit 5)branch nameyynProvider Branch to use to evaluate pending pacts when fetching pacts to verify.
pactbroker.includeWipPactsSinceVerification (JUnit, JUnit 5)ISO date (YYYY-MM-DD)nynThe earliest date WIP pacts should be included (ex: YYYY-MM-DD). If no date is provided, WIP pacts will not be included.
pact.verification.reportDirVerification (JUnit, JUnit 5)Directory namenynSets the directory to write any configured verification reports to.
pactfolder.pathVerification (JUnit, JUnit 5)Directory namenynDirectory to fetch pacts from when using the folder loader.
pact.verification.ignoreIoErrorsVerification (JUnit, JUnit 5)true, falsenynWhen a test is annotated with @IgnoreNoPactsToVerify, any IO errors that occur while fetching the pacts will also be ignored .
pact.provider.nameVerification (JUnit 5)string valuenyySets the provider name to use when running the Pact verification tests.
pact.provider.versionVerificationstring valuennnSets the provider version to use when publishing verification results.
pact.provider.version.trimSnapshotVerificationtrue, falsennnEnabling this will trim the Maven snapshot suffix off the Provider version.
pact.provider.tagVerificationProvider namesyynList of provider tags to use to tag the verification results with when published back to the Pact Broker.
pact.provider.branchVerificationVCS branch namenynBranch name for the provider from the version control system to record when publishing verification results.
pact.filter.descriptionVerificationstring value or regexnnnFilters the interactions to be verified.
pact.filter.pacturlVerificationURLnynOverrides the URL to use to fetch the Pacts to verify. This should be used when a webhook from the Pact broker has triggered the build.
pact.filter.consumersVerificationstring valueyynFilters the pacts by the consumer names to verify when fetched from older Pact brokers. Replaced with consumer version selectors in newer Pact brokers.
pact.filter.providerStateVerificationregex or empty stringnynFilters the interactions by the provider state names to verify. If set, it is a regular expression matched against the provider state names. If set to the empty string, will match interactions with no provider state.
pact.verifier.enableRedirectHandlingVerificationtrue, falsennnIf set to false, will disable automatically following redirects.
pact.verifier.classpathscan.verboseVerificationtruennnif set (to any value), will enable verbose logging of class path scanning. Turning this option on can consume a lot of memory and generate a lot of logs.
pact.verifier.buildUrlVerificationURLnnnSets the build URL to send with the verification results.
pact.verifier.publishResultsVerificationtrue, falsenynIf set to true, will publish the results of the verification back to the Pact broker. Should only be enabled in CI.
pact.showFullDiffVerificationtrue, falsenynIf set to true, will add a full diff of the request or response payloads to the verification reports or output.
pact.showStacktraceVerificationtrue, falsenynIf set to true and the verification fails due an exception that is raised, will print the full stack trace of the exception.
pact.defaultVersionAllV1, V2, V3, V4nyyIf not version is specified, Pact framework will default to this version