flyway / flyway

Flyway by Redgate • Database Migrations Made Easy.
https://flywaydb.org
Apache License 2.0
7.95k stars 1.49k forks source link

Flyway for GCP Spanner not working with V8.5.13 #3787

Open skumar568 opened 8 months ago

skumar568 commented 8 months ago
Which version and edition of Flyway are you using?

flyway-core:: 8.5.13 (as per SpringBoot 2.7.7) flyway-gcp-spanner :: 8.5.14-beta spring-boot :: 2.7.7 JDK 17

If this is not the latest version, can you reproduce the issue with the latest one as well? (Many bugs are fixed in newer releases and upgrading will often resolve the issue)

flyway-core latest (10.0.0) not compatible with Spring Boot 2.7.7

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

JAVA

Which database are you using? (Type & version)

GCP Spanner

Which operating system are you using?

Windows

What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)

I just booted Spring Boot with flyway migration to initialize the schema. POM.xml is as below:- `

org.springframework.boot spring-boot-starter-data-jpa
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-rest-core</artifactId>
        <version>3.7.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-spanner-hibernate-dialect</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-spanner-jdbc</artifactId>
    </dependency>

    <!-- flyway configs -->
    <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-gcp-spanner</artifactId>
        <version>8.5.13-beta</version>
    </dependency>

</dependencies>`

application.properties as below:- ` server.port=8090

Data Source Configs

spring.datasource.url=jdbc:cloudspanner:/projects/pid-gousgnad-dapd-mp-c/instances/dev-eval/databases/vt-db spring.datasource.driver-class-name=com.google.cloud.spanner.jdbc.JdbcDriver spring.jpa.database-platform=com.google.cloud.spanner.hibernate.SpannerDialect

`

What did you expect to see?

DB schema initialized by Flyway.

What did you see instead?

Getting error as below:- Caused by: java.util.ServiceConfigurationError: org.flywaydb.core.extensibility.Plugin: Provider org.flywaydb.core.internal.schemahistory.BaseAppliedMigration not found at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) ~[na:na] at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219) ~[na:na] at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228) ~[na:na] at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) ~[na:na] at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) ~[na:na] at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) ~[na:na] at org.flywaydb.core.internal.plugin.PluginRegister.registerPlugins(PluginRegister.java:44) ~[flyway-core-8.5.13.jar:na] at org.flywaydb.core.internal.plugin.PluginRegister.getPlugins(PluginRegister.java:58) ~[flyway-core-8.5.13.jar:na] at org.flywaydb.core.internal.plugin.PluginRegister.getPlugins(PluginRegister.java:64) ~[flyway-core-8.5.13.jar:na] at org.flywaydb.core.api.configuration.ClassicConfiguration.configureFromConfigurationProviders(ClassicConfiguration.java:1661) ~[flyway-core-8.5.13.jar:na] at org.flywaydb.core.api.configuration.ClassicConfiguration.configure(ClassicConfiguration.java:1345) ~[flyway-core-8.5.13.jar:na] at org.flywaydb.core.api.configuration.ClassicConfiguration.<init>(ClassicConfiguration.java:412) ~[flyway-core-8.5.13.jar:na] at org.flywaydb.core.Flyway.<init>(Flyway.java:100) ~[flyway-core-8.5.13.jar:na] at org.flywaydb.core.api.configuration.FluentConfiguration.load(FluentConfiguration.java:59) ~[flyway-core-8.5.13.jar:na] at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.flyway(FlywayAutoConfiguration.java:126) ~[spring-boot-autoconfigure-2.7.7.jar:2.7.7]

Kindly suggest if I am missing anything.

tjs145 commented 8 months ago

Have you tried it on Flyway version 9.22.3?

skumar568 commented 8 months ago

same issue with 9.22.3 as well. Is there any working sample for SpringBoot + Flyway + Spanner?