Note that demo page is a Heroku app so it may be sleeping when you first open the page, it may take 1-2 min for server to wake up.
Just add the dependency to your maven/gradle of your Spring Boot application then it will autoconfigure itself and
Better Error Pages will be available if your active profiles includes dev
or development
.
Adding the dependency to your project
<dependencies>
<dependency>
<groupId>com.github.kodgemisi</groupId>
<artifactId>better-error-pages-spring-boot-starter</artifactId>
<version>${better-error-pages-spring-boot-starter.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
See https://jitpack.io/#kodgemisi/better-error-pages-spring-boot-starter for Jitpack usage, dependency details, version info and Gradle usage.
Better Error Pages;
-
sets
server.error.include-stacktrace: always
andserver.error.include-exception: true
automatically. -
autoconfigures itself if active profile has
dev
ordevelopment
however you can override this viabetter-error-pages.profiles
property. -
finds your
@SpringBootApplication
annotated class and use its package name asbetter-error-pages.package-name
name however you can override this viabetter-error-pages.package-name
property.
Tip
|
Note that package-name should be typically your own base package which is used throughout your own classes like com.yourcompany .
|
better-error-pages:
package-name: <String> # A package name whose classes' source code will be parsed and displayed in error pages.
profiles: <String or List of string> # Override default profiles to enable Better Error Pages. Default value: "dev, development"
Important
|
Setting better-error-pages.package-name property improves startup performance significantly but won’t affect runtime performance.
|
Warning
|
If you set
|
-
Won’t work for package names containing upper case characters.
-
Can’t show source code in multi module projects only if the project is run as packaged but other features will work.
-
When running multi module projects from an IDE everything just works.
-
© Copyright 2018 Kod Gemisi Ltd.
Mozilla Public License 2.0 (MPL-2.0)
MPL is a copyleft license that is easy to comply with. You must make the source code for any of your changes available under MPL, but you can combine the MPL software with proprietary code, as long as you keep the MPL code in separate files. Version 2.0 is, by default, compatible with LGPL and GPL version 2 or greater. You can distribute binaries under a proprietary license, as long as you make the source available under MPL.