Closed
Description
I've always wanted to have a fancy banner that works in production AND during development.
But if you start with a fresh springboot project and run it from your ide, or with mvn spring-boot:run
, or during tests, values are not interpreted AND the defaults don't show up either.
I raised a similar isue in #34713 but it's not working in development runs.
To test this, I put this in src/main/resources/banner.txt
:
Coloring : ${Ansi.BLUE}Blue text${AnsiColor.DEFAULT}
Styling : ${AnsiStyle.BOLD}BOLD text${AnsiStyle.NORMAL}
!! Without defaults !!
application.version : ${application.version}
application.formatted-version : ${application.formatted-version}
spring-boot.version : ${spring-boot.version}
spring-boot.formatted-version : ${spring-boot.formatted-version}
application.title : ${application.title}
non-existing-property : ${non-existing-property}
!! With defaults !!
application.version : ${application.version:123}
application.formatted-version : ${application.formatted-version:v123}
spring-boot.version : ${spring-boot.version:456}
spring-boot.formatted-version : ${spring-boot.formatted-version:version456}
application.title : ${application.title:TiTlE}
non-existing-property : ${non-existing-property:non-existing-property}
It renders OK if I start the jar with java -jar target/demo-0.0.1-SNAPSHOT.jar
:
But during aforementioned tests, I get this: