For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

  • Java 8 or higher is required

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 sealights-java-version.txt
Invoke-WebRequest -Uri "https://agents.sealights.co/sealights-java/sealights-java-latest.zip" -OutFile "sealights-java-latest.zip"
Expand-Archive -Path "sealights-java-latest.zip" -DestinationPath "sealights-java" -Force
Get-Content .\sealights-java\sealights-java-version.txt

The package contains:

  • sl-build-scanner.jar

  • sl-test-listener.jar

  • sealights-java-version.txt

For CD Only mode, only sl-test-listener.jar is required.

CD Only Mode Configuration

CD Only mode is enabled using:

This mode combines:

  • Application code scan phase

  • Coverage collection at runtime for test execution open continuously or by test runners

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.labId

Unique lab identifier.

-Dsl.includes

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.buildName

Version/build identifier. Defaults to the date-time value will be used as build name

-Dsl.branchName

Component branch name. Defaults to Unspecified if not provided.

-Dsl.workspace

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

-Dsl.filesIncluded

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. Default is: *.class,*.jar,*.war,*.ear

-Dsl.filesExcluded

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.excludes

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.

-Dsl.enabled

Can be used to disable the agent without removing the javaagent flag

Examples

Logging

Enable console logging:

Enable file logging:

When not specified, Default log folder is logs in the current working directory

Validation

Once the application starts:

  • Navigate to: Cockpit → Live Agents Monitor

  • Verify the agent appears online

You can also validate JVM arguments locally:

Validation in logs

Review lines that contain Sealights in them, like:

SeaLights FTV Agent was invoked and SeaLights Test Listener is running

Last updated

Was this helpful?