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

Command Reference

Agent Files

There are two agent files:

  • Build Scanner - sl-build-scanner.jar

  • Test Listener - sl-test-listener.jar

Java Agent — Command Reference

Build Scanner - Generating a Session ID (config)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

##Minimum required CLI parameters
java -jar sl-build-scanner.jar config \
  --token <token> \
  --appName <app-name> \
  --branchName <branch> \
  --buildName <build> \
  --includePackages <include> \
  --excludePackages <exclude>

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--appName

--appname

Name of the application.

--branchName

--branch

The source branch of the application.

--buildName

--build

The build label of the current build.

--includePackages

--packagesincluded

Comma-separated list of packages to include in scan. Supports wildcards (* - any string, ? - any character). For example, 'com.example.* ,io.*.demo, com.?ello.world'.

--excludePackages

--packagesexcluded

Comma-separated list of packages to exclude from scan. Supports wildcards (* - any string, ? - any character). For example, 'com.example.* ,io.*.demo, com.?ello.world'.

--buildSessionId

--buildsessionid

Optional: A user provided session ID (The ID must be under 40 characters length).

--buildSessionIdFile

--buildsessionidfile

Path to a file to save the build session id in (Default: buildSessionId.txt).

--failOnError

--enableNoneZeroErrorCode

Indicates that the Build Scanner should return with error code in case of scan failure. On: return 1, Off: return 0.

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

Build Scanner - Pull Request Session (prConfig)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--appName

--appname

Name of the application.

--branchName

--branch

The source branch of the application.

--buildName

--build

The build label of the current build.

--includePackages

--packagesincluded

Comma-separated list of packages to include in scan. Supports wildcards (* - any string, ? - any character). For example, 'com.example.* ,io.*.demo, com.?ello.world'.

--excludePackages

--packagesexcluded

Comma-separated list of packages to exclude from scan. Supports wildcards (* - any string, ? - any character). For example, 'com.example.* ,io.*.demo, com.?ello.world'.

--buildSessionId

--buildsessionid

Optional: A user provided session ID (The ID must be under 40 characters length).

--buildSessionIdFile

--buildsessionidfile

Path to a file to save the build session id in (Default: buildSessionId.txt).

--failOnError

--enableNoneZeroErrorCode

Indicates that the Build Scanner should return with error code in case of scan failure. On: return 1, Off: return 0.

--pullRequestNumber

--pullRequestNumber

The number assigned to the Pull Request from the source control.

--targetBranch

--targetBranch

The branch to which this Pull Request will be merged into (already reported to SeaLights).

--latestCommit

--latestCommit

The full SHA of the last commit made to the Pull Request.

--repositoryUrl

--repoUrl

The Pull Request URL for the PR to be scanned, up until the section before the pullRequestNumber value.

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

Build Scanner - Scanning a Build (scan)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--buildSessionId

--buildsessionid

Build Session ID (case-sensitive).

--buildSessionIdFile

--buildsessionidfile

Path to a buildSessionId.txt file.

--appName

--appname

Name of the application.

--branchName

--branch

The source branch of the application.

--buildName

--build

The build label of the current build.

--includePackages

--packagesincluded

Comma-separated list of packages to include in scan. Supports wildcards (* - any string, ? - any character). For example, 'com.example.* ,io.*.demo, com.?ello.world'.

--includeFiles

--filesIncluded

Comma-separated list of files to include in scan. Supports wildcards (* - any string, ? - any character). For example: '*-with-dependencies.jar,

use comma separated file names or paths like 'SpecificFileName1.class,specificFileName2.class' OR 'some/sub/folder/*Test.class,another/folder/*/resources/*'.

Don’t use dot separated packages such as *.ms.*.gateways.mappers.implementation.MapResource.class.

--excludePackages

--packagesexcluded

Comma-separated list of packages to exclude from scan. Supports wildcards (* - any string, ? - any character). For example, 'com.example.* ,io.*.demo, com.?ello.world'.

--excludeFiles

--filesExcluded

Comma-separated list of files to exclude from scan. Supports wildcards (* - any string, ? - any character). For example: '*-with-dependencies.jar,

use comma separated file names or paths like 'SpecificFileName1.class,specificFileName2.class' OR 'some/sub/folder/*Test.class,another/folder/*/resources/*'.

Don’t use dot separated packages such as *.ms.*.gateways.mappers.implementation.MapResource.class.

--scanDir

--workspacePath

Path to the workspace where the source code exists.

--componentFile

--dependenciesFile

A path to a json file with components data in the following format: [{"appName":"","branchName":"","buildName":""},{...}] or [{"buildSessionId":"", {...}].

--customFilterFile

--customFilterFile

A path to custom exclusions filter file in json format.

--moduleName

--moduleName

Module name used in the pom.xml file. Example, my-app.

--failOnError

--enableNoneZeroErrorCode

Indicates that the Build Scanner should return with error code in case of scan failure. On: return 1, Off: return 0.

--noPropertiesFile

--noPropertiesFile

Do not generate Sealights. properties file.

--propertiesFileName

--propertiesFileName

Path in which to create the Sealights properties file (Default: sealights.properties).

--pathToMetaJson

--pathToMetaJson

Optional: Path to a json file with metadata about the build.

--repositoryUrl

--scmUrl

The URL to the repository which contains the code. If left blank, the url of the remote GIT origin is being used.

--scmProvider

--scmProvider

The provider name of your Source Control Management (SCM). Supported values: Github, Bitbucket, Gitlab (Default: Gitlab).

--scmType

--scm

The name of your Source Control Management (SCM) tool. Supported values: git, none (Default: git).

--scmVersion

--scmVersion

The version of your Source Control Management (SCM) tool. If left blank, cloud version is assumed. Otherwise, specify the version of your on-premise server.

--sourceDirectory

--sourceDirectory

Custom source directory in Maven or Gradle project (case-sensitive).

--sourcePath

--sourcePath

Path to the directory where the source classes exists. Default value is the --scanDir path.

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

Build Scanner - Build Scan End (buildend)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--buildSessionId

--buildsessionid

Build Session ID (case-sensitive).

--buildSessionIdFile

--buildsessionidfile

Path to a buildSessionId.txt file.

--failed

--failed

Indicates build failure.

--ok

--ok

Indicates build success.

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

Build Scanner - Updating/Deleting a component from an integration build (componentUpdate)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--buildSessionId

--buildsessionid

Build Session ID (case-sensitive).

--buildSessionIdFile

--buildsessionidfile

Path to a buildSessionId.txt file.

--componentFile

--dependenciesFile

A path to a json file with components data in the following format: [{"appName":"","branchName":"","buildName":""},{...}] or [{"buildSessionId":"", {...}].

--componentIds

--componentIds

One or more build session ID's (comma separated) of the components to be updated or deleted.

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

Test Listener

Test Listener - Opening a Test Stage (start)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--appName

--appname

Name of the application.

--branchName

--branch

The source branch of the application.

--buildName

--build

Build label of the current build.

--testStage

--testStage

Name of the test stage. Example, Integration Tests, Regression Tests, etc.

--labId

--labid

Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive).

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

sl.calibrationLearning enables calibration learning mode for Test Optimization (TIA).

This property can be set as a Java system property:

Or as an environment variable:

When set to true, the test run is marked as a calibration execution for Test Optimization.

Available since: SeaLights Java Agent v4.0.2610.

Test Listener - Uploading Report Files (uploadReports)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--appName

--appname

Name of the application.

--branchName

--branch

The source branch of the application.

--buildName

--build

Build label of the current build.

--labId

--labid

Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive).

--hasMoreRequests

--hasMoreRequests

Set as false in order to force this run to end the test execution after the upload (Default: true).

--reportFile

--reportFile

Report files. This argument can be declared multiple times in order to upload multiple files.

--reportFilesFolder

--reportFilesFolder

Folder that contains the report files. All files in this folder will be uploaded. This argument can be declared multiple times in order to upload multiple files from multiple folders.

--source

--source

The reports provider (Default: Junit xml report).

--type

--type

The report type.

Values:

  • JUnitReport - For uploading JUnit test report files

  • commitLog - For uploading git style commit logs

(Default: JunitReport).

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

Test Listener - Closing a Test Stage (end)

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

All CLI Parameters

CLI Parameter
Legacy Alias
Description

--token

--token

Access token generated from the SeaLights server.

--tokenFile

--tokenfile

Path to file containing access token generated from the SeaLights server.

--appName

--appname

Name of the application.

--branchName

--branch

The source branch of the application.

--buildName

--build

Build label of the current build.

--labId

--labid

Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive).

--proxy

--proxy

Address of proxy to run connection through.

--help

--help

Show Help message and exit.

--quiet

--quiet

Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is false.

Installing test listener as Java Agent

The listener needs to be placed alongside the server and added to the JVM command line using the -javaagent parameter together with its required parameters.

Usually, the easiest is to place it in the JAVA_OPTS="...", although it can also be placed in the JVM command itself.

Parameter
Description

javaagent

Path to Sealights Java test agent jar.

sl.token

Access token generated from the SeaLights server.

sl.tokenFile

Path to file containing the access token generated from the SeaLights server.

sl.buildSessionId

Session ID of configuration created.

sl.buildSessionIdFile

Path to file containing the Session ID of configuration created.

sl.tags

One or several tags (comma separated) to be passed to Sealights in order to label the test listener in the cockpit.

sl.labId

Unique ID for a set of test labs in case multiple labs are running simultaneously.

sl.proxy

Address of proxy to run connection through.

sl.testStage

Name of the test stage (When running with JMeter).

sl.filesStorage

Path to a folder that the agent can save temporary files to.

sl.webappLocation

Optional: Path to the folder containing the artifact of the application (Default: webapps). If the property is provided, the agent looks recursively inside the .war and .ear files in the path defined by the property. The search stops on the first file found. This parameter is used when the agent does not find automatically the sltoken.txt and buildSessionId.txt files added to the artifact by Sealights Maven or Gradle plugins during the build.

sl.collectorUrl

HTTP/HTTPS DNS to the collector for when working with lambda methods.

Logging

In order to enable logs, you can set the following parameters as environment variables or, when using as javaagent, add them as -Dsl.* parameters. Both console output and file options are compatible and non-exclusive.

For logging into the console, add:

For logging into a file, add:

Parameter
Description

sl.log.level

Sets the log level to one of the following: off, error, warn, info, debug.

sl.log.toConsole

Set to true to enable log output to the console.

sl.log.toFile

Set to true to enable log output to a file.

sl.log.folder

Provide a folder to save the log files in.

sl.log.filename

Provide the name of the log file.

sl.log.count

Limit the number of log files to create (Default: 10).

sl.log.limit

Limit the size of the log file in megabytes (MB) (Default: 10 (i.e. 10*1024 KB)).

--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED

Special JVM parameter to allow logging in Java 9 and later in addition to -Dsl.log.* options above. If the option is not provided, the test listener will work as usual, but logging will not work.

Last updated

Was this helpful?