Safeguard
Developer Tools•

What is inside a Spring Boot executable JAR and how do I inventory it?

A Spring Boot executable JAR nests dependency jars under BOOT-INF/lib. Learn the layout, the index files and how to list every library it ships.

Safeguard Security Team
3 min read

A Spring Boot executable JAR keeps your classes under BOOT-INF/classes and every dependency as an intact nested jar under BOOT-INF/lib. Because the libraries stay whole, you can list them from the archive and match each one to an advisory, unlike a shaded JAR.

Definition and layout

Java has no standard way to load jars nested inside another jar. The Spring Boot documentation says Boot avoids the shaded approach and nests dependency jars directly. The layout is:

PathHolds
META-INF/MANIFEST.MFManifest
org/springframework/boot/loaderSpring Boot Loader classes
BOOT-INF/classesYour application classes
BOOT-INF/libDependency jars, nested

For war files, dependencies go in WEB-INF/lib, and those needed only for embedded running go in WEB-INF/lib-provided.

The index files

Two optional files sit under BOOT-INF.

classpath.idx lists jars in the order they are added to the classpath. Build plugins usually generate it, and it is used only with java -jar.

layers.idx splits the archive into layers for container image builds, for example a dependencies layer and an application layer.

For an inventory, classpath.idx and the BOOT-INF/lib listing are the two quickest sources of truth.

How to inventory one

  1. List the nested jars: unzip -l app.jar | grep BOOT-INF/lib.
  2. Read the file names. They normally carry artifact and version, such as a name followed by a version number.
  3. Turn each into a package URL so it can be matched to advisories, see how to write a purl for Maven.
  4. Compare against your build tool's tree. Anything in the JAR that is not in the tree deserves an explanation.
  5. Store the list with the build, and rescan when new advisories appear.

What to look for

  • Old versions held back by a managed BOM, see overriding a managed version.
  • Duplicate libraries at different versions.
  • Libraries you thought you had excluded.
  • Nested jars that are themselves shaded, which hide further copies.

Why layers are useful for inventory

The layer index groups dependency jars apart from your application classes. When you scan an image built from the archive, findings in the dependencies layer point at libraries, and findings elsewhere point at your own code or base image.

Try it yourself

Click through it at your own pace, or open it full screen.

Watch how findings are tied to packages inside an image. The same idea applies to the layers of a Boot image.

Where Safeguard fits

Safeguard scans container images and dependencies, and produces SBOMs you can store with each build. Try the free scan on a repository that builds a Boot application.

Quick check

Where do the libraries live in a Boot JAR?

As nested jars in BOOT-INF/lib. Your own classes are in BOOT-INF/classes.

Does classpath.idx apply in my IDE?

No. The documentation says it is used only with java -jar, not in IDEs or with spring-boot:run or bootRun.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.