When build plugins generate application code

Zero declared dependencies; a Maven plugin's transitive payload generates runtime code during the build

Test case
maven-plugin-hidden-content
Ecosystems
maven
Scanned at
source, artefact

The application and how it is built

A Java application that declares no dependencies at all. Its build runs a Maven plugin, trace-injector-maven-plugin, in the generate-sources phase. The plugin has a dependency of its own, trace-route-payload, which carries a route definition. The plugin turns that into a Java class and a ServiceLoader entry, and both are compiled into the application's jar.

What gets hidden, and how

Maven resolves a plugin and the plugin's dependencies into a classloader of their own, separate from the project's dependency graph. Code the plugin generates ends up in the jar as the application's own classes, with nothing to say where it came from.

ComponentMechanismIn the artefact?What happens to it
trace-injector-maven-plugin@1.0.0plugin-realmdoes not shipbound to generate-sources; generates GeneratedTraceRoute.java and ServiceLoader metadata
trace-route-payload@1.0.0plugin-realmdoes not shiptransitive dependency of the plugin; carries the /hidden/build-info route that ends up compiled into the jar

What a true SBOM would say

1 components ship. 4 are known not to ship (4 build-tooling). 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

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.

sourceartefact
Componentcapyclicdxgencyclonedx-maven-pluginsbom-plus-maven-pluginsbom-toolsyfttrivybomcdxgensyfttrivy (raw archive)trivy
Ships. In the artefact, including components that were shaded or bundled on the way in.
maven-plugin-hidden-content@1.0.0
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.
trace-injector-maven-plugin@1.0.0 plugin-realm
trace-route-payload@1.0.0 plugin-realm

Every document

Content accuracyBaseline conformance
ToolFormatCompsIn scopeShipped foundWrong verWrong purlLeakedLabelledHashes okNTIA 2021NTIA/CISA 2026BSI v2.1
source
capycli 2.12.0cyclonedx000/100000/06.76.05.7
cdxgen 11.3.2cyclonedx000/100000/06.78.05.7
cyclonedx-maven-plugin 2.9.1cyclonedx111/100000/08.86.25.0
sbom-plus-maven-plugin 1.1.0cyclonedx1721721/10004+1670/010.09.99.2
sbom-tool 4.1.13spdx111/100000/010.05.94.0
syft 1.51.0cyclonedx111/100000/04.54.33.4
trivy 0.74.0cyclonedx321/100000/04.94.03.6
artefact
bom 0.8.0spdx000/100000/06.75.64.3
cdxgen 11.3.2cyclonedx221/100000/08.66.14.5
syft 1.51.0cyclonedx111/100000/04.94.73.7
trivy-rawfile 0.74.0cyclonedx110/100000/03.14.44.1
trivy 0.74.0cyclonedx110/100000/03.14.44.1

Reading the result

The jar contains one package, the application itself, so a tool that names only that has described what ships. What it has not described is that part of the application's behaviour came from a plugin's dependency. That is a build-time influence, and an SBOM can record it only by listing what the build ran. Whether it should depends on what the SBOM is for. The benchmark counts such a listing as correct when it is marked as not shipping.

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/maven-plugin-hidden-content@1.0.0primary component; the only package in the jar