1
resposta

problema com o flyway

Olá pessoal gostaria que alguem me ajudasse, pois nao consigo prosseguir com o modulo POST do curso, pois alterei algo na migration do flyway, e está dando erro.


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.configureProperties(FlywayAutoConfiguration.java:201)

The following method did not exist:

'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.failOnMissingLocations(boolean)'

The calling method's class, org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration, was loaded from the following location:

jar:file:/home/joaocoder/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.1.4/spring-boot-autoconfigure-3.1.4.jar!/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class

The called method's class, org.flywaydb.core.api.configuration.FluentConfiguration, is available from the following locations:

jar:file:/home/joaocoder/.m2/repository/org/flywaydb/flyway-core/7.8.0/flyway-core-7.8.0.jar!/org/flywaydb/core/api/configuration/FluentConfiguration.class

The called method's class hierarchy was loaded from the following locations:

org.flywaydb.core.api.configuration.FluentConfiguration: file:/home/joaocoder/.m2/repository/org/flywaydb/flyway-core/7.8.0/flyway-core-7.8.0.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration and org.flywaydb.core.api.configuration.FluentConfiguration

Process finished with exit code 0 ```

1 resposta

Olá Felipe! Tudo bem?

O erro que você está recebendo indica que há uma incompatibilidade entre as versões do Flyway utilizadas em sua aplicação.

Uma possível solução para esse problema é verificar as dependências do Flyway em seu arquivo "pom.xml" e garantir que todas as versões estejam compatíveis entre si. Certifique-se de que a versão do flyway-core seja a mesma utilizada pelo flyway-mysql. Para fazer isso, como no pom.xml você está passando a versão 7.8.0 no flyway-core, tente passar essa versão para o flyway-mysql também:

<dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <version>7.8.0</version>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-mysql</artifactId>
            <version>7.8.0</version>
        </dependency>

Caso o problema persista, avisa aqui por favor. Abraços e bons estudos!