Coverage Reporting for Embedded Java Libraries
Applications that embed JAR/WAR components may not show per‑component coverage unless multi‑component mode is correctly configured.
Problem
When Java applications include multiple embedded components—such as shared libraries packaged inside EAR/WAR files—coverage may not appear for those components because the agent cannot attribute coverage without multi‑component configuration.
Solution
Prerequisites
Make sure:
Each component is built in its own pipeline (unique Build Session ID).
Each component contains its specific
buildSessionId.txtinside the packaged JAR/WAR - Build step usesincludeResources: true(or leave it out—the default is true)..Final application (EAR/WAR) preserves embedded artifacts unchanged.
Required Runtime Configuration
Add these JVM flags to the application under test:
-Dsl.multipleComponents=true \
-Dsl.webappLocation=<absolute-path-to-deployment-directory>According to your deployment methodology:
If the application is deployed in an exploded form, the
sl.webappLocationproperty must point to the exploded directory.If the application is not exploded,
sl.webappLocationshould instead point to the directory that contains the EAR or WAR file, rather than the file itself.
If your embedded libraries use package names outside the main application’s namespace, you must explicitly include them:
-Dsl.includes=com.company.app.*,com.company.lib.*You are correctly configured when:
Common issues
Only top-level app visible in Live Agents →
sl.multipleComponents=truenot setAgent warns about components not detected → Wrong
sl.webappLocationComponent shows 0% coverage →
buildSessionId.txtmissing
Last updated
Was this helpful?

