How can liquibase banner be turned off in spring boot?

Viewed 704

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.

1 Answers

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.

Related