From 89b11b0078ec53a6d858c94688c5638c671eab07 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 15 Oct 2020 10:18:03 +0200 Subject: [PATCH] Upgrade to Liquibase 3.10.3 This commit upgrades to Liquibase 3.10.3 and adds an explicit exclude check as this version started to include a "banner.txt" at the root of the classpath. Given it may override a banner configured by the user it is ignored so that the default banner is displayed. Users impacted by this change can rename their banner and configure the "spring.banner.location" property to point to it. Closes gh-23658 --- .../spring-boot-dependencies/build.gradle | 2 +- .../boot/SpringApplicationBannerPrinter.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index d2fdc4ca19..2e5d2fb732 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -936,7 +936,7 @@ bom { ] } } - library("Liquibase", "3.10.2") { + library("Liquibase", "3.10.3") { group("org.liquibase") { modules = [ "liquibase-core" { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java index 34da198a7e..a9502aef6a 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.springframework.boot; import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; @@ -88,8 +89,13 @@ class SpringApplicationBannerPrinter { private Banner getTextBanner(Environment environment) { String location = environment.getProperty(BANNER_LOCATION_PROPERTY, DEFAULT_BANNER_LOCATION); Resource resource = this.resourceLoader.getResource(location); - if (resource.exists()) { - return new ResourceBanner(resource); + try { + if (resource.exists() && !resource.getURL().toExternalForm().contains("liquibase-core")) { + return new ResourceBanner(resource); + } + } + catch (IOException ex) { + // Ignore } return null; }