Application version does not show up in Spring Boot banner.txt
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Spring Boot can display application metadata in banner.txt, but ${application.version} often shows as blank when build metadata is not generated or not loaded at runtime. Developers expect Maven/Gradle project versions to appear automatically, yet Boot only resolves placeholders that exist in the environment, manifest, or generated build-info. This article explains how version placeholders are resolved, how to wire build metadata correctly, and how to verify banner output in local and CI builds.
How Banner Placeholders Are Resolved
banner.txt supports placeholders such as ${spring-boot.version} and ${application.version}. The important difference is that spring-boot.version is built-in, while application.version needs to come from your project metadata.
Example banner.txt:
If application.version is empty, Boot did not find it in environment properties.
Generate Build Metadata with Maven or Gradle
For reliable version exposure, generate build-info.properties.
Maven:
Gradle:
Then Boot can expose values from BuildProperties and environment mapping.
Expose Version as Property Explicitly
If your banner expects ${application.version}, provide it via application.properties or build filtering.
With Maven resource filtering enabled, @project.version@ is replaced during build.
Alternative for Gradle:
Then use application.version=${version} pattern.
Troubleshooting Runtime Differences
Many teams see correct output in IDE runs but not in packaged jars, or vice versa. Verify actual runtime artifact contents:
Also log resolved properties at startup:
This confirms whether property resolution or banner interpolation is failing.
Practical Verification Workflow
A strong way to avoid regressions is to validate changes in three stages: baseline, targeted change, and repeatability. First, capture a baseline command/output before applying fixes so you can prove improvement. Second, apply one focused change at a time, then rerun the exact same check to confirm causality. Third, rerun the validation multiple times (or with nearby input variants) to ensure behavior is stable and not a one-off pass.
A simple validation template:
If your stack has tests, add at least one regression test that fails before the fix and passes after it. This turns troubleshooting knowledge into durable protection against future changes. In team environments, including the exact commands used for verification in pull requests or runbooks makes results reproducible across machines and CI.
Operational Checklist for Production Use
Before shipping a fix or optimization, confirm environment parity and observability. Verify toolchain/runtime versions, capture key metrics, and define rollback criteria. A technically correct local fix can still fail in production if infrastructure assumptions differ.
A minimal release checklist usually includes: compatible dependency versions, representative test coverage, explicit monitoring signals, and a rollback plan. This discipline reduces the chance that a local solution introduces new issues under real traffic or larger datasets.
Common Pitfalls
- Assuming
${application.version}is built-in like ${spring-boot.version}. - Forgetting to generate build info during packaging.
- Enabling placeholders in
banner.txtwithout injecting matching properties. - Verifying only IDE runs instead of packaged artifact behavior.
- Using resource filtering incorrectly and shipping unresolved tokens.
Summary
If application version is missing in banner.txt, the root issue is usually missing build metadata or unresolved property mapping. Generate build info, inject project version explicitly, and validate final jar contents. With those steps, banner version display becomes deterministic across local, CI, and production deployments.

