Update Flyway to 10.10.0
This commit is contained in:
parent
de28783171
commit
a5945158bd
|
@ -168,7 +168,7 @@
|
|||
<maven-invoker.version>3.2.0</maven-invoker.version>
|
||||
<awaitility.version>4.2.0</awaitility.version>
|
||||
<jboss-logmanager.version>3.0.4.Final</jboss-logmanager.version>
|
||||
<flyway.version>9.22.3</flyway.version>
|
||||
<flyway.version>10.10.0</flyway.version>
|
||||
<yasson.version>3.0.3</yasson.version>
|
||||
<!-- liquibase-mongodb is not released everytime with liquibase anymore, but the two versions need to be compatible -->
|
||||
<liquibase.version>4.26.0</liquibase.version>
|
||||
|
@ -5691,6 +5691,26 @@
|
|||
<artifactId>flyway-database-oracle</artifactId>
|
||||
<version>${flyway.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-postgresql</artifactId>
|
||||
<version>${flyway.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-db2</artifactId>
|
||||
<version>${flyway.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-derby</artifactId>
|
||||
<version>${flyway.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-mongodb</artifactId>
|
||||
<version>${flyway.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.liquibase</groupId>
|
||||
<artifactId>liquibase-core</artifactId>
|
||||
|
|
|
@ -34,7 +34,8 @@ public class FlywayAlwaysEnabledProcessor {
|
|||
|
||||
@BuildStep
|
||||
IndexDependencyBuildItem indexFlyway() {
|
||||
return new IndexDependencyBuildItem("org.flywaydb", "flyway-core");
|
||||
// we need to index all Flyway dependencies
|
||||
return new IndexDependencyBuildItem("org.flywaydb", null);
|
||||
}
|
||||
|
||||
@BuildStep
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.nio.file.Files;
|
|||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.AbstractCollection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -25,6 +26,7 @@ import org.flywaydb.core.Flyway;
|
|||
import org.flywaydb.core.api.Location;
|
||||
import org.flywaydb.core.api.callback.Callback;
|
||||
import org.flywaydb.core.api.migration.JavaMigration;
|
||||
import org.flywaydb.core.extensibility.ConfigurationExtension;
|
||||
import org.jboss.jandex.AnnotationInstance;
|
||||
import org.jboss.jandex.ClassInfo;
|
||||
import org.jboss.jandex.ClassType;
|
||||
|
@ -80,6 +82,20 @@ class FlywayProcessor {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(FlywayProcessor.class);
|
||||
|
||||
@BuildStep
|
||||
void reflection(CombinedIndexBuildItem index, BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) {
|
||||
List<String> configurationExtensions = new ArrayList<>();
|
||||
configurationExtensions.add(ConfigurationExtension.class.getName());
|
||||
|
||||
for (ClassInfo configurationExtension : index.getIndex().getAllKnownImplementors(ConfigurationExtension.class)) {
|
||||
configurationExtensions.add(configurationExtension.name().toString());
|
||||
}
|
||||
|
||||
reflectiveClasses
|
||||
.produce(ReflectiveClassBuildItem.builder(configurationExtensions.toArray(new String[0])).fields().methods()
|
||||
.build());
|
||||
}
|
||||
|
||||
@Record(STATIC_INIT)
|
||||
@BuildStep
|
||||
MigrationStateBuildItem build(BuildProducer<NativeImageResourceBuildItem> resourceProducer,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package io.quarkus.flyway.runtime;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -140,9 +141,14 @@ class FlywayCreator {
|
|||
* (see Flyway#createResourceAndClassProviders)
|
||||
*/
|
||||
|
||||
// this configuration is important for the scanner
|
||||
configure.encoding(StandardCharsets.UTF_8);
|
||||
configure.detectEncoding(false);
|
||||
configure.failOnMissingLocations(false);
|
||||
|
||||
// the static fields of this class have already been set at static-init
|
||||
QuarkusPathLocationScanner quarkusPathLocationScanner = new QuarkusPathLocationScanner(
|
||||
Arrays.asList(configure.getLocations()));
|
||||
configure, Arrays.asList(configure.getLocations()));
|
||||
configure.javaMigrationClassProvider(new QuarkusFlywayClassProvider<>(quarkusPathLocationScanner.scanForClasses()));
|
||||
configure.resourceProvider(new QuarkusFlywayResourceProvider(quarkusPathLocationScanner.scanForResources()));
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||
|
||||
import org.flywaydb.core.api.Location;
|
||||
import org.flywaydb.core.api.callback.Callback;
|
||||
import org.flywaydb.core.api.configuration.Configuration;
|
||||
import org.flywaydb.core.api.migration.JavaMigration;
|
||||
import org.flywaydb.core.api.resource.LoadableResource;
|
||||
import org.flywaydb.core.internal.resource.classpath.ClassPathResource;
|
||||
|
@ -30,7 +31,7 @@ public final class QuarkusPathLocationScanner implements ResourceAndClassScanner
|
|||
private final Collection<LoadableResource> scannedResources;
|
||||
private final Collection<Class<? extends JavaMigration>> scannedMigrationClasses;
|
||||
|
||||
public QuarkusPathLocationScanner(Collection<Location> locations) {
|
||||
public QuarkusPathLocationScanner(Configuration configuration, Collection<Location> locations) {
|
||||
LOGGER.debugv("Locations: {0}", locations);
|
||||
|
||||
this.scannedResources = new ArrayList<>();
|
||||
|
@ -45,7 +46,7 @@ public final class QuarkusPathLocationScanner implements ResourceAndClassScanner
|
|||
scannedResources.add(new ClassPathResource(null, migrationFile, classLoader, StandardCharsets.UTF_8));
|
||||
} else if (migrationFile.startsWith(Location.FILESYSTEM_PREFIX)) {
|
||||
if (fileSystemScanner == null) {
|
||||
fileSystemScanner = new FileSystemScanner(StandardCharsets.UTF_8, false, false, false);
|
||||
fileSystemScanner = new FileSystemScanner(false, configuration);
|
||||
}
|
||||
LOGGER.debugf("Checking %s for migration files", migrationFile);
|
||||
Collection<LoadableResource> resources = fileSystemScanner.scanForResources(new Location(migrationFile));
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package io.quarkus.flyway.runtime.graal;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.flywaydb.core.api.Location;
|
||||
import org.flywaydb.core.api.configuration.Configuration;
|
||||
import org.flywaydb.core.internal.scanner.LocationScannerCache;
|
||||
import org.flywaydb.core.internal.scanner.ResourceNameCache;
|
||||
import org.flywaydb.core.internal.scanner.Scanner;
|
||||
|
@ -15,15 +12,15 @@ import com.oracle.svm.core.annotate.TargetClass;
|
|||
* Needed to get rid of some Android related classes
|
||||
*/
|
||||
@TargetClass(Scanner.class)
|
||||
public final class ScannerSubstitutions {
|
||||
public final class ScannerSubstitutions<I> {
|
||||
|
||||
@Substitute
|
||||
public ScannerSubstitutions(Class<?> implementedInterface, Collection<Location> locations, ClassLoader classLoader,
|
||||
Charset encoding,
|
||||
boolean detectEncoding,
|
||||
public ScannerSubstitutions(
|
||||
Class<I> implementedInterface,
|
||||
boolean stream,
|
||||
ResourceNameCache resourceNameCache, LocationScannerCache locationScannerCache,
|
||||
boolean throwOnMissingLocations) {
|
||||
ResourceNameCache resourceNameCache,
|
||||
LocationScannerCache locationScannerCache,
|
||||
Configuration configuration) {
|
||||
throw new IllegalStateException("'org.flywaydb.core.internal.scanner.Scanner' is never used in Quarkus");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-flyway</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-hibernate-orm</artifactId>
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-flyway</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest</artifactId>
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-flyway</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-resteasy</artifactId>
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-flyway</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-postgresql</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-resteasy</artifactId>
|
||||
|
|
Loading…
Reference in New Issue