Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Liquibase 4.0.0 #11147

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<jgit.version>5.8.0.202006091008-r</jgit.version>
<flyway.version>6.5.3</flyway.version>
<yasson.version>1.0.7</yasson.version>
<liquibase.version>3.10.1</liquibase.version>
<liquibase.version>4.0.0</liquibase.version>
<snakeyaml.version>1.26</snakeyaml.version>
<osgi.version>6.0.0</osgi.version>
<neo4j-java-driver.version>4.1.1</neo4j-java-driver.version>
Expand Down Expand Up @@ -4111,11 +4111,6 @@
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.version}</version>
</dependency>

<dependency>
<groupId>org.webjars</groupId>
Expand Down
66 changes: 0 additions & 66 deletions extensions/liquibase/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,72 +64,6 @@
</annotationProcessorPaths>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>extract-liquibase-for-indexing</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.liquibase</includeGroupIds>
<outputDirectory>${project.build.directory}/liquibase-extracted</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<indexName>liquibase.idx</indexName>
<processDefaultFileSet>false</processDefaultFileSet>
<fileSets>
<fileSet>
<directory>${project.build.directory}/liquibase-extracted</directory>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-liquibase-index</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes/</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/liquibase-extracted</directory>
<includes>
<include>META-INF/liquibase.idx</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions extensions/liquibase/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>

<!-- test dependencies -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,24 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

import javax.sql.DataSource;

import org.jboss.logging.Logger;

import io.quarkus.agroal.runtime.DataSources;
import io.quarkus.arc.Arc;
import io.quarkus.liquibase.LiquibaseFactory;
import io.quarkus.liquibase.runtime.graal.LiquibaseServiceLoader;
import io.quarkus.runtime.annotations.Recorder;
import liquibase.Liquibase;
import liquibase.exception.ServiceNotFoundException;
import liquibase.servicelocator.ServiceLocator;

/**
* The liquibase recorder
*/
@Recorder
public class LiquibaseRecorder {

private static final Logger log = Logger.getLogger(LiquibaseRecorder.class);

private final List<LiquibaseContainer> liquibaseContainers = new ArrayList<>(2);

public void setServicesImplementations(Map<String, List<String>> serviceLoader) {
LiquibaseServiceLoader.setServicesImplementations(serviceLoader);
}

public Supplier<LiquibaseFactory> liquibaseSupplier(String dataSourceName) {
DataSource dataSource = DataSources.fromName(dataSourceName);
LiquibaseContainerProducer liquibaseProducer = Arc.container().instance(LiquibaseContainerProducer.class).get();
Expand Down Expand Up @@ -69,28 +57,4 @@ public void doStartActions() {
throw new IllegalStateException(e);
}
}

public void setJvmServiceImplementations(Map<String, List<String>> services) {
ServiceLocator.setInstance(new ServiceLocator() {

@Override
public <T> Class<? extends T>[] findClasses(Class<T> requiredInterface) throws ServiceNotFoundException {
List<String> found = services.get(requiredInterface.getName());
if (found == null) {
log.warnf("Failed to find pre-indexed service %s, falling back to slow classpath scanning",
requiredInterface);
return super.findClasses(requiredInterface);
}
List<Class<? extends T>> ret = new ArrayList<>();
for (String i : found) {
try {
ret.add((Class<? extends T>) Class.forName(i, false, Thread.currentThread().getContextClassLoader()));
} catch (ClassNotFoundException e) {
log.error("Failed to load Liquibase service", e);
}
}
return ret.toArray(new Class[0]);
}
});
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import com.oracle.svm.core.annotate.RecomputeFieldValue;
import com.oracle.svm.core.annotate.TargetClass;

@TargetClass(className = "liquibase.util.StringUtils")
final class SubstituteStringUtils {
@TargetClass(className = "liquibase.util.StringUtil")
final class SubstituteStringUtil {

@Alias
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset)
Expand Down