Running Service-Lint in CI

Service-Lint is designed to run both locally (via mvn) and in CI (Jenkins). This page covers the options that matter most in an automated pipeline.

Running as Part of the Build

With the plugin bound to the check goal in an execution (see Getting Started), Service-Lint runs automatically as part of the normal Maven lifecycle:

mvn verify

To run only the lint step:

mvn service-lint:check

Alternatively, run the standalone CLI in a pipeline step and gate on its exit code — see CLI Usage.

Gating on Results

Service-Lint returns exit code 1 when ERROR-level violations are found, 0 otherwise. WARNING and INFO violations do not fail the build. See Understanding Reports.

  • To block merges on ERRORs, leave failOnViolation at its default (true).

  • To report without blocking (e.g. while rolling out new rules), set failOnViolation=false:

    mvn service-lint:check -DfailOnViolation=false

Tuning for CI Memory Constraints

Rules run in parallel by default. If your CI agents (e.g. Jenkins executors) hit memory limits, disable parallelism so rules run sequentially:

mvn service-lint:check -Dparallel=false

or, in the plugin configuration:

<configuration>
  <parallel>false</parallel>
</configuration>

Latest Rules in CI

Declare service-lint-rules with version RELEASE so pipelines automatically pick up the newest rules via ServiceLoader, even if the plugin version lags. New rules are enabled by default, so maintain your servicelint-config.yml if you need to opt out of any. See Configuration.

Emergency Skip

For a one-off pipeline where Service-Lint must not run at all, skip it entirely:

mvn verify -Dservice-lint.skip=true

Use sparingly — this disables all checks. See Skipping & Disabling.