Java applications containing bundled JavaScript

Jakarta WAR with an npm library pulled through mvnpm inside the esbuild plugin realm, deployed on a Payara image

Test case
payara-mvnpm
Ecosystems
maven, npm
Scanned at
source, artefact, image

The application and how it is built

A Jakarta EE web application packaged as a WAR and deployed on a Payara server image. It has one ordinary Maven dependency, commons-lang3, which ships as a jar in WEB-INF/lib. Its browser code uses lodash-es, which arrives as a Maven artifact from mvnpm, declared as a dependency of the esbuild Maven plugin and not of the project. esbuild bundles it into assets/app.js. The Jakarta API is provided scope: needed to compile, supplied by the server, and absent from the WAR.

What gets hidden, and how

lodash-es is hidden twice. It enters through a plugin's dependencies, so it is never in the project's dependency graph. It is then bundled, so no package boundary survives in the WAR.

ComponentMechanismIn the artefact?What happens to it
lodash-es@4.17.21plugin-realm+bundledshipsa plugin dependency of esbuild-maven-plugin, bundled into assets/app.js; never in the project graph
esbuild-maven-plugin@2.0.0plugin-realmdoes not shipruns inside a Maven plugin's classloader, never in the project's dependency graph

What a true SBOM would say

3 components ship, 1 of them transformed on the way in. 4 are known not to ship (3 build-tooling, 1 provided). Those influence the build or run during it; a tool may list them, as long as it marks them.

The list was written by hand from the build files, the lockfiles and the listing of the built archive, and the project's own proof-check.sh asserts what ends up in the artefact. It is in expected.json, and the full list of what ships is at the foot of this page.

What the tools reported

Shipped components found, by stage

Out of 3 that ship. Only the tools that scan all three stages are drawn; the table below has every tool.

03sourceartefactimagesyft, source: 2 of 3syft, artefact: 2 of 3syft, image: 2 of 3trivy, source: 2 of 3trivy, artefact: 1 of 3trivy, image: 2 of 3cdxgen, source: 3 of 3cdxgen, artefact: 1 of 3cdxgen, image: 1 of 3syft: 2 of 3trivy: 2 of 3cdxgen: 1 of 3
syfttrivycdxgen

Component by component

Ships: Y exact version, v wrong version, p wrong group or namespace, n not named. Does not ship: L listed and marked, X listed unmarked, · not listed. A tool appears under a stage only if it was run there, so an empty column never stands for a miss. Select a cell to see what is behind it.

Select a cell.

sourceartefactimage
Componentcapyclicdxgencyclonedx-maven-pluginsbom-plus-maven-pluginsbom-toolsyfttrivybomcdxgensyfttrivy (raw archive)trivycdxgendocker-scoutsyfttrivy
Ships. In the artefact, including components that were shaded or bundled on the way in.
payara-mvnpm-trace-lab@1.0.0
commons-lang3@3.18.0
lodash-es@4.17.21 plugin-realm+bundled
Present in the build, absent from the artefact. Plugins and their payloads, imported BOMs, and dependencies the build file requires but the artefact never contains. Listing one is right when it is marked as not shipping.
esbuild-maven-plugin@2.0.0 plugin-realm

Every document

Content accuracyBaseline conformance
ToolFormatCompsIn scopeShipped foundWrong verWrong purlLeakedLabelledHashes okNTIA 2021NTIA/CISA 2026BSI v2.1
source
capycli 2.12.0cyclonedx27271/3002600/08.44.43.7
cdxgen 11.3.2cyclonedx70703/3000670/08.25.44.0
cyclonedx-maven-plugin 2.9.1cyclonedx28282/3002601/18.48.44.7
sbom-plus-maven-plugin 1.1.0cyclonedx2562563/300029+2221/110.010.09.2
sbom-tool 4.1.13spdx61613/3005800/010.04.43.6
syft 1.51.0cyclonedx732/300100/06.14.43.4
trivy 0.74.0cyclonedx432/300000/05.74.33.7
artefact
bom 0.8.0spdx000/300000/06.75.64.3
cdxgen 11.3.2cyclonedx111/300000/08.86.95.0
syft 1.51.0cyclonedx222/300000/05.74.93.8
trivy-rawfile 0.74.0cyclonedx110/300000/03.14.44.1
trivy 0.74.0cyclonedx221/300001/16.16.14.3
image
cdxgen 11.3.2cyclonedx5903781/300000/07.95.13.2
docker-scout 1.24.0spdx6564562/300000/010.06.23.5
syft 1.51.0cyclonedx5894502/300000/02.34.42.2
trivy 0.74.0cyclonedx5834462/300001/18.77.13.7

Details

Reading the result

A tool that reads the project's dependency graph has no way to see lodash-es; a tool that lists what the build ran can name it at the source stage. The provided-scope API is the opposite case: it is in the graph and does not ship, so a tool that lists it without a scope overstates the WAR. In the image, the server's own libraries far outnumber the application's three components. Recall against so short a list says little about an image SBOM on its own.

This is our interpretation. The counts above are what the run recorded; why a tool found or missed something is inferred from how the tool works, not established by the data. Limits of the benchmark.

Evidence

Ground truth: what ships

ComponentNote
pkg:maven/dev.noregressions.trace/payara-mvnpm-trace-lab@1.0.0primary component (WAR)
pkg:maven/org.apache.commons/commons-lang3@3.18.0ordinary dependency; survives as WEB-INF/lib/commons-lang3-3.18.0.jar
pkg:maven/org.mvnpm/lodash-es@4.17.21a plugin dependency of esbuild-maven-plugin, bundled into assets/app.js; never in the project graph