Scrivio Interview library
ConceptFoundations6 min read · updated 12 November 2026

What is an SBOM, which formats are common, and how can a Java build produce one?

An SBOM, a Software Bill of Materials, is a machine-readable list of every component in an artifact, with versions and usually licenses and hashes. The two common formats are CycloneDX and SPDX. A Maven build can produce one with the cyclonedx-maven-plugin and a Gradle build with the CycloneDX Gradle plugin, and recent Spring Boot versions can package the SBOM inside the application and expose it through an actuator endpoint (check your version). An SBOM only pays off when it is stored and linked to the artifact that is actually deployed.

Why this question is asked

SBOMs moved from a niche topic to a routine requirement in a few years: governments and large customers ask for them, and every incident like Log4Shell reminds companies how hard it is to answer what software they are running. Interviewers ask this question to see whether we know what an SBOM really contains, how to produce one from a Java build without much effort, and why producing it is only half the job. In this answer, we will see what an SBOM is, compare the two main formats, generate one with Maven and Gradle, look at Spring Boot's built-in support, and see what it takes for the SBOM to be useful.

1What an SBOM Is

Think of the ingredients list on a food package. An SBOM is the same idea for software: a list of everything our artifact is made of. For a Spring Boot service, that means our own module plus every library in BOOT-INF/lib, which for a typical service is between 80 and 200 components. For each component, the SBOM records its name and version, usually in the form of a package URL, a standard identifier such as pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.19.0. It often also records a hash of the file, the license and how components depend on each other.

Because the list is machine-readable, tools can use it without opening the artifact. A vulnerability platform can compare it against new advisories every day, a license tool can check that nothing violates company policy, and a customer can review what we ship. The key word is accurate: an SBOM should describe what is really inside the artifact, so it is best generated during the build, when the build tool knows the exact resolved versions.

2CycloneDX and SPDX

There are two widely used formats, both open standards with JSON and XML forms. They overlap a lot, and most tools can read both, but they come from different places.

The two common SBOM formats
CycloneDXSPDX
OriginOWASP, security focusedLinux Foundation, license focused
Standard statusECMA-424ISO/IEC 5962
Strong atVulnerabilities, VEX, servicesLicenses, file-level detail
Java toolingMaven and Gradle plugins, Spring BootSPDX Maven plugin, Syft and others
Either is a sound choice; pick one for the company so every tool reads the same format.

For Java teams focused on vulnerability management, CycloneDX is the more common choice, largely because the build plugins are mature and Spring Boot supports it directly. If legal teams drive the requirement, SPDX may be preferred. Converters exist between them, though some details can be lost.

3Generating an SBOM With Maven and Gradle

In Maven we add the CycloneDX plugin and bind it to the package phase. The makeAggregateBom goal writes one SBOM for the whole multi-module project, and makeBom writes one per module. In Gradle, applying the org.cyclonedx.bom plugin adds a cyclonedxBom task.

XML
<!-- pom.xml (with the Spring Boot parent, the plugin version is managed; check yours) -->
<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals><goal>makeAggregateBom</goal></goals>
</execution>
</executions>
</plugin>
// build.gradle.kts
plugins {
id("org.cyclonedx.bom") version "2.3.0" // check the current version
}
// ./gradlew cyclonedxBom -> build/reports/bom.json (path depends on the plugin version)
// A component inside the generated JSON:
// {
// "type": "library",
// "group": "com.fasterxml.jackson.core", "name": "jackson-databind", "version": "2.19.0",
// "purl": "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.19.0",
// "hashes": [ { "alg": "SHA-256", "content": "..." } ],
// "licenses": [ { "license": { "id": "Apache-2.0" } } ]
// }

Notice that the plugins work from the resolved dependency graph, so the SBOM contains the versions that conflict resolution actually chose, not what we wrote in the pom. We should generate it from the runtime classpath, the same one that is packaged, so test-only libraries do not appear as shipped components.

4Spring Boot's Built-In SBOM Support

Spring Boot 3.3 added first-class SBOM support, and later versions keep it (check your version for details). When the CycloneDX plugin is applied, Spring Boot's build plugins include the generated SBOM inside the executable jar, under META-INF/sbom, and the application can expose it through the actuator sbom endpoint.

Java
# application.properties
management.endpoints.web.exposure.include=health,sbom
$ curl -s localhost:8080/actuator/sbom
# {"ids":["application"]}
$ curl -s localhost:8080/actuator/sbom/application | jq '.components | length'
# 143

This is useful because the SBOM travels with the artifact: whatever is running can tell us what it contains. But we should treat the endpoint as sensitive, because a full component list helps attackers find vulnerable versions. Expose it only on a management port or internal network, and protect it like other actuator endpoints.

5An SBOM Is Only Useful If It Is Stored and Linked

A file in a build folder that disappears when the CI agent is cleaned helps nobody. To be useful, the SBOM must be kept for as long as the artifact can run, stored next to it in the artifact repository, and linked to deployments so that we know which SBOM describes the version running in production. Uploading it to a platform such as OWASP Dependency-Track adds the payoff: the platform re-checks every stored SBOM against new advisories, so when a new CVE appears we can search for the component and see every affected version and service immediately.

So the full picture is a small pipeline: generate the SBOM in every release build, publish it with the artifact, record which version went where, and keep an index we can query. Without the last three steps, we have produced a document; with them, we have an inventory.

Step throughFrom build to a useful inventory
  1. Build resolves dependenciesthe exact versions that will be packaged
  2. Generate the CycloneDX SBOMMaven or Gradle plugin, in the release build
  3. Publish it next to the jar or imagesame version, same repository
  4. Record the deploymentwhich artifact version runs in which environment
  5. Index and monitorfor example Dependency-Track, re-checked daily

5 steps in order. Play them, or step through them one at a time.

6Follow-up questions

Does an SBOM of the jar cover the container image?

No. The jar's SBOM lists Java dependencies, but the image also contains the operating system packages, the JDK and anything else added in the Dockerfile. For an image we also generate an image SBOM with a tool such as Syft or Trivy, or combine the two, so that vulnerabilities in the base image are covered too.

What is the difference between an SBOM and a lockfile?

A lockfile, such as Gradle's dependency locking file, pins versions so builds resolve the same dependencies, and it serves the build tool. An SBOM describes what a finished artifact contains, with identifiers, hashes and licenses in a standard format, and serves people and tools outside the build. They often list similar versions, but they answer different questions.

Can we trust an SBOM a vendor gives us?

Only as much as we trust how it was produced. A signed SBOM generated by the vendor's build system is stronger than one written by hand afterwards. We can also generate our own SBOM by scanning the vendor's artifact and compare the two; large differences are worth asking about.

7Conclusion

In this answer, we saw that an SBOM is a machine-readable list of the components in an artifact, with versions, identifiers and often licenses and hashes, written in CycloneDX or SPDX. Java builds produce one with the CycloneDX Maven or Gradle plugin from the resolved graph, and recent Spring Boot versions embed it in the jar and expose it through an actuator endpoint. Its value comes from storing it with the artifact, linking it to deployments and indexing it so we can query it when the next vulnerability appears.

What to say in the interviewAbout 80 seconds aloud

Open with

An SBOM, a software bill of materials, is an ingredients list for an artifact: every component inside it, with its version, usually as a package URL, and often its license and a hash.

Then, if they want more

The two common formats are CycloneDX, from OWASP, which is strong for security use and supports VEX, and SPDX, from the Linux Foundation, which is strong for licenses; both are standards with JSON forms. In a Java build I would use the cyclonedx-maven-plugin with the makeAggregateBom goal bound to package, or the org.cyclonedx.bom plugin in Gradle.

They work from the resolved dependency graph, so the SBOM shows the versions that are really packaged. Since Spring Boot 3.3, if the CycloneDX plugin is applied, Boot puts the SBOM inside the jar and can expose it through the actuator sbom endpoint, which I would keep on an internal management port because it helps attackers too.

The important part is what happens afterwards: the SBOM must be stored next to the artifact, linked to which version is deployed where, and indexed in something like Dependency-Track, so that when a new CVE appears we can query it and get the affected services in minutes.

About this answer

Last updated
12 November 2026
Versions it names
Spring Boot 3.3
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "What is an SBOM, which formats are common, and how can a Java build produce one?": https://scrivio-interview-library.netlify.app/java/dependency-and-supply-chain/0c2583999f/