Java Agent - CD Only Mode

This document describes how to configure the Java Agent in CD Only mode using -Dsl.mode=scanAndCoverage

Overview

The Java Agent runs directly alongside your Java application as a JVM javaagent.

Each deployed component should run its own SeaLights agent instance.

Prerequisites

Before onboarding:

  • Obtain a SeaLights Agent Token

  • Ensure HTTPS access to SeaLights

  • Have access to modify JVM startup parameters

Downloading the Agent

Download and extract the latest Java Agent:

wget -nv https://agents.sealights.co/sealights-java/sealights-java-latest.zip && \
unzip -oq sealights-java-latest.zip && \
cat version.txt

The package contains:

  • sl-build-scanner.jar

  • sl-test-listener.jar

  • sealights-java-version.txt

CD Only Mode Configuration

CD Only mode is enabled using:

This mode combines:

  • Application code scan phase

  • Coverage collection during test execution phase

Required System Properties

System Properties
Description

-Dsl.mode=scanAndCoverage

(Mandatory for CD Only mode) Enables CD Only mode.

-Dsl.token or -Dsl.tokenFile

SeaLights agent token.

-Dsl.appName

Application/component name.

-Dsl.buildName

Version/build identifier.

-Dsl.labId

Unique lab identifier.

-Dsl.includePackages

Comma-separated list of packages to scan. Supports wildcards (* = any string, ? = any character). Example, com.mycompany.service.* ,com.acme,orders.*, io.company.*.api.

Optional System Properties

These System Properties may be required depending on your specific configuration or environment limitations (for example, proxy configuration).

System Properties
Description

-Dsl.branchName

Component branch name. Defaults to unspecified if not provided.

-Dsl.scanDir

Folders to search for files to be scanned (Default: current working directory).

-Dsl.includeFiles

Comma-separated list of files to scan. Supports wildcards (* = any string, ? = any character). Note: Each file is evaluated using its full path. Unless specifying the full path explicitly, the pattern should begin with *. Example, *original-*.jar, *demo?.jar.

-Dsl.excludeFiles

Comma-separated list of search patterns with wildcards for files to exclude from the scan. Note: Each file is evaluated using its full path. Unless specifying the full path explicitly, the pattern should begin with *. Example, *-with-dependencies.jar , *bad-bad?.war, *-source.jar.

-Dsl.excludePackages

Comma-separated list of packages to exclude from scan. Supports wildcards (* = any string, ? = any character). Example, com.mycompany.test.*, io.*.demo, com.acme.*mock*, com.company.internal.*.

-Dsl.recursive

Enables recursive scanning of workspace paths. Default value is true.

-Dsl.proxy

Proxy configuration used by the agent when communicating with SeaLights.

-Dsl.tags

Free-text comma-separated tags used to help identify agents later in the Cockpit.

Examples

Logging

Enable console logging:

Enable file logging:

Validation

Once the application starts:

  • Navigate to: Cockpit → Live Agents Monitor

  • Verify the agent appears online

You can also validate JVM arguments locally:

Last updated

Was this helpful?