Using Java Agents - Scanning a build
In order to collect coverage information SeaLights agents need to first scan the binary files for the build information.
It can be the *.class
, *.jar
or even the *.war
files.
Scanning a build (single module)
Scanning a build in Java is done using the Java Build scanner with the -scan flag for files located in workspace folder only.
java -jar sl-build-scanner.jar -scan -tokenfile /path/to/sltoken.txt -buildsessionidfile buildSessionId.txt -workspacepath "/path/to/war/files" -fi "*.war"
Scanning a build in Java for all files located in workspace folder and it's subdirectories, is done using the Java Build scanner with the -scan
flag and -r
flag.
java -jar sl-build-scanner.jar -scan -tokenfile /path/to/sltoken.txt -buildsessionidfile buildSessionId.txt -workspacepath "/path/to/war/files" -fi "*.class" -r
Scanning multi modules
If you want to report separate parts of the application as separate modules, you can do so with the -moduleName
option.
java -jar sl-build-scanner.jar -scan -tokenfile /path/to/sltoken.txt -buildsessionidfile buildSessionId.txt -workspacepath "/path/to/war/files" -fi "*.war" -moduleName "moduleName"
It is important to always use the exact same module names each time you report a new build.
When you finish reporting all the modules, you need to send the event with the -buildend
option and either the -ok
or -failed
depending on the result of your build process.
See 'Java Command Reference - Scanning a build' for full parameter details