How to Generate Interactive Spring Boot Startup Reports for Faster Apps

This guide explains how to add the spring-boot-startup-report library to a Spring Boot project, generate interactive HTML startup reports with bean details and flame graphs, view them during runtime or integration tests, and configure the dependency for production or test scopes.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
How to Generate Interactive Spring Boot Startup Reports for Faster Apps

Spring Boot Startup Report

The library generates an interactive HTML page that shows detailed startup information, bean instantiation, flame graphs, and allows searching by class or annotation.

Features

Interactive HTML page available at runtime

Generated during integration tests

Flame graph visualization

Search by class or annotation

The report table provides deep insight into bean creation.

Flame graph offers a more visual representation.

How to Use

Note: The report generation requires Jackson on the classpath. If you already have spring-boot-starter-web or spring-boot-starter-json , you are fine; otherwise add the Jackson dependency:
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
</dependency>

Add the spring-boot-startup-report dependency:

<dependency>
    <groupId>com.maciejwalkowiak.spring</groupId>
    <artifactId>spring-boot-startup-report</artifactId>
    <version>0.1.0</version>
    <optional>true</optional>
</dependency>

Run the application and visit http://localhost:8080/startup-report.

Be aware the library depends on org.springframework:spring-test and org.springframework.boot:spring-boot-test; consider marking it as optional for production builds.

Using with Unit Tests

When on the classpath, the library automatically generates a startup report for each application context during integration tests annotated with @SpringBootTest. Reports are placed in target/startup-reports (Maven) or build/startup-reports (Gradle).

For test slices such as @WebMvcTest or @DataJpaTest, add @Import(StartupEventsAutoConfiguration.class) at the top of the test class:

@Import(StartupEventsAutoConfiguration.class)
@WebMvcTest(OwnerController.class)
public class OwnerControllerTests {
    ...
}

If you only need test reports without a runtime endpoint, declare the dependency with test scope:

<dependency>
    <groupId>com.maciejwalkowiak.spring</groupId>
    <artifactId>spring-boot-startup-report</artifactId>
    <version>0.1.0</version>
    <scope>test</scope>
</dependency>
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performancespring-bootstartup-report
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.