Update to Liquibase 4.8.0
Closes #10678 Co-authored-by: Stefan Guilhen <sguilhen@redhat.com> Co-authored-by: Martin Kanis <mkanis@redhat.com>
This commit is contained in:
parent
842218a7ed
commit
8aa394ca6b
9 changed files with 25 additions and 9 deletions
|
@ -81,11 +81,11 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>4.6.2</version>
|
<version>4.8.0</version>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>Apache Software License 2.0</name>
|
<name>Apache Software License 2.0</name>
|
||||||
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.6.2/LICENSE.txt</url>
|
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.8.0/LICENSE.txt</url>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
|
@ -81,11 +81,11 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>4.6.2.redhat-00001</version>
|
<version>4.8.0.redhat-00001</version>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>Apache Software License 2.0</name>
|
<name>Apache Software License 2.0</name>
|
||||||
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.6.2/LICENSE.txt</url>
|
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.8.0/LICENSE.txt</url>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
|
@ -96,11 +96,11 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>3.6.2</version>
|
<version>4.8.0</version>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>Apache Software License 2.0</name>
|
<name>Apache Software License 2.0</name>
|
||||||
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.6.2/LICENSE.txt</url>
|
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.8.0/LICENSE.txt</url>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
|
@ -81,11 +81,11 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>4.6.2.redhat-00001</version>
|
<version>4.8.0.redhat-00001</version>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>Apache Software License 2.0</name>
|
<name>Apache Software License 2.0</name>
|
||||||
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.6.2/LICENSE.txt</url>
|
<url>https://raw.githubusercontent.com/liquibase/liquibase/v4.8.0/LICENSE.txt</url>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
|
@ -26,6 +26,7 @@ import liquibase.database.jvm.JdbcConnection;
|
||||||
import liquibase.exception.LiquibaseException;
|
import liquibase.exception.LiquibaseException;
|
||||||
import liquibase.resource.ClassLoaderResourceAccessor;
|
import liquibase.resource.ClassLoaderResourceAccessor;
|
||||||
import liquibase.resource.ResourceAccessor;
|
import liquibase.resource.ResourceAccessor;
|
||||||
|
import liquibase.ui.LoggerUIService;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.keycloak.Config;
|
import org.keycloak.Config;
|
||||||
import org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider;
|
import org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider;
|
||||||
|
@ -81,6 +82,7 @@ public class DefaultLiquibaseConnectionProvider implements LiquibaseConnectionPr
|
||||||
final Map<String, Object> scopeValues = new HashMap<>();
|
final Map<String, Object> scopeValues = new HashMap<>();
|
||||||
scopeValues.put(Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(this.getClass().getClassLoader()));
|
scopeValues.put(Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(this.getClass().getClassLoader()));
|
||||||
scopeValues.put(Scope.Attr.classLoader.name(), this.getClass().getClassLoader());
|
scopeValues.put(Scope.Attr.classLoader.name(), this.getClass().getClassLoader());
|
||||||
|
scopeValues.put(Scope.Attr.ui.name(), new LoggerUIService());
|
||||||
try {
|
try {
|
||||||
Scope.enter(scopeValues);
|
Scope.enter(scopeValues);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -137,7 +137,7 @@
|
||||||
<freemarker.version>2.3.31</freemarker.version>
|
<freemarker.version>2.3.31</freemarker.version>
|
||||||
|
|
||||||
<jetty9.version>${jetty92.version}</jetty9.version>
|
<jetty9.version>${jetty92.version}</jetty9.version>
|
||||||
<liquibase.version>4.6.2</liquibase.version>
|
<liquibase.version>4.8.0</liquibase.version>
|
||||||
<osgi.version>4.2.0</osgi.version>
|
<osgi.version>4.2.0</osgi.version>
|
||||||
<pax.web.version>7.1.0</pax.web.version>
|
<pax.web.version>7.1.0</pax.web.version>
|
||||||
<servlet.api.30.version>1.0.2.Final</servlet.api.30.version>
|
<servlet.api.30.version>1.0.2.Final</servlet.api.30.version>
|
||||||
|
|
|
@ -19,9 +19,13 @@ package org.keycloak.quarkus.runtime.storage.database.liquibase;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.xml.parsers.SAXParserFactory;
|
import javax.xml.parsers.SAXParserFactory;
|
||||||
|
|
||||||
|
import liquibase.Scope;
|
||||||
|
import liquibase.ui.LoggerUIService;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.keycloak.Config;
|
import org.keycloak.Config;
|
||||||
import org.keycloak.connections.jpa.updater.liquibase.conn.LiquibaseConnectionProvider;
|
import org.keycloak.connections.jpa.updater.liquibase.conn.LiquibaseConnectionProvider;
|
||||||
|
@ -63,6 +67,16 @@ public class QuarkusLiquibaseConnectionProvider implements LiquibaseConnectionPr
|
||||||
protected void baseLiquibaseInitialization(KeycloakSession session) {
|
protected void baseLiquibaseInitialization(KeycloakSession session) {
|
||||||
resourceAccessor = new ClassLoaderResourceAccessor(getClass().getClassLoader());
|
resourceAccessor = new ClassLoaderResourceAccessor(getClass().getClassLoader());
|
||||||
|
|
||||||
|
// initialize Liquibase using a custom scope
|
||||||
|
final Map<String, Object> scopeValues = new HashMap<>();
|
||||||
|
scopeValues.put(Scope.Attr.ui.name(), new LoggerUIService());
|
||||||
|
try {
|
||||||
|
Scope scope = Scope.getCurrentScope();
|
||||||
|
scope.enter(scopeValues);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("Failed to initialize Liquibase: " + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
// disables XML validation
|
// disables XML validation
|
||||||
for (ChangeLogParser parser : ChangeLogParserFactory.getInstance().getParsers()) {
|
for (ChangeLogParser parser : ChangeLogParserFactory.getInstance().getParsers()) {
|
||||||
if (parser instanceof XMLChangeLogSAXParser) {
|
if (parser instanceof XMLChangeLogSAXParser) {
|
||||||
|
|
Loading…
Reference in a new issue