I am setting up liquibase in a spring boot app. On app startup liquibase overrides default spring boot banner and shows a liquibase banner:
####################################################
## _ _ _ _ ##
## | | (_) (_) | ##
## | | _ __ _ _ _ _| |__ __ _ ___ ___ ##
## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \ ##
## | |___| | (_| | |_| | | |_) | (_| \__ \ __/ ##
## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___| ##
## | | ##
## |_| ##
## ##
## Get documentation at docs.liquibase.com ##
## Get certified courses at learn.liquibase.com ##
## Get advanced features and support at ##
## liquibase.com/support ##
## ##
####################################################
How can I go back to default spring boot banner? I know that I can disable banners in spring boot, load a banner from a file, but I believe I should be able to explictly tell liquibase to stop showing it's banner.
Another way to disable the Spring Boot startup banner is to change the banner text to an empty file. Then we create a new empty file in src/main/resources named banner. txt.
For Spring 5.liquibase. enabled=false application property disables Liquibase.
For Spring 5.x.x: the spring.liquibase.enabled=false application property disables Liquibase. P.S. And for Flyway: Add liquibase.enabled=false in your application.properties file But if you don't want to use liquibase from application anymore, remove liquibase starter altogether from pom. This property was migrated to spring.liquibase.enabled.
You can disable the default banner by setting the spring.main.banner-mode property to off. The default value for this properties entry is console which means the output is not part of the logs. Apart from off and console this property can take log as one more value where the banner info is printed on the logs.
That's why you have to remove the liquibase starter, or any direct liquibase dependency if you added any. If you only have the liquibase maven plugin, liquibase is not in the application classpath.
Introduction Spring Boot is a great way to create Java web applications, but some of its default behavior may not be ideal for everyone. One particular feature is the Spring Boot banner that gets printed at startup:
In Liquibase 3.10.3/4.1.1 its banner has been extracted to the separate file called banner.txt
. So, starting from these versions, this file will be in the classpath if you have the liquibase-core
dependency.
Surprisingly, Spring relies on a file with the same name when it chooses the banner text. As a result, it takes Liquibase's banner accidentally and prints it. So, it's not really a fault of Liquibase.
Maybe we can raise an issue in Liquibase repo to ask them about renaming that file for the convenience of all Spring users. But for now, I see the only way to fix it - to use Spring's standard approaches of working with banners as you said (of course, it' always possible to downgrade Liquibase version too).
EDIT: Found that the issue about it has already been raised: https://github.com/liquibase/liquibase/issues/1476
EDIT 2: The problem has been fixed in Liquibase 4.2.0 by moving the banner.txt
to the different location. See the release notes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With