This commit is contained in:
Phillip Webb 2024-06-11 09:35:59 -07:00
parent 20fbe74dfe
commit d37098153c
3 changed files with 7 additions and 3 deletions

View File

@ -54,16 +54,15 @@ class NativeImageResourceProviderCustomizer extends ResourceProviderCustomizer {
configuration.isFailOnMissingLocations());
}
catch (NoSuchMethodError ex) {
// Flyway 10
return createFlyway10Scanner(configuration);
}
}
private static Scanner<?> createFlyway10Scanner(FluentConfiguration configuration) throws LinkageError {
try {
Constructor<?> scannerConstructor = Scanner.class.getDeclaredConstructor(Class.class, boolean.class,
Constructor<?> constructor = Scanner.class.getDeclaredConstructor(Class.class, boolean.class,
ResourceNameCache.class, LocationScannerCache.class, Configuration.class);
return (Scanner<?>) scannerConstructor.newInstance(JavaMigration.class, false, new ResourceNameCache(),
return (Scanner<?>) constructor.newInstance(JavaMigration.class, false, new ResourceNameCache(),
new LocationScannerCache(), configuration);
}
catch (Exception ex) {

View File

@ -32,8 +32,10 @@ class MyIntegrationTests {
}
companion object {
@Container
val neo4j = Neo4jContainer("neo4j:5")
}
}

View File

@ -34,9 +34,12 @@ class MyIntegrationTests {
}
companion object {
@Container
@ServiceConnection
@JvmStatic
val neo4j = Neo4jContainer("neo4j:5");
}
}