springboot整合flyway出现异常具体如下
***************************
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.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:65)
The following method did not exist:
org.flywaydb.core.Flyway.migrate()I
The method's class, org.flywaydb.core.Flyway, is available from the following locations:
jar:file:/E:/apache-maven-3.6.3-bin/maven-repository/org/flywaydb/flyway-core/7.3.1/flyway-core-7.3.1.jar!/org/flywaydb/core/Flyway.class
It was loaded from the following location:
file:/E:/apache-maven-3.6.3-bin/maven-repository/org/flywaydb/flyway-core/7.3.1/flyway-core-7.3.1.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.flywaydb.core.Flyway
看见最后语句没有,重复jar,仔细检查一下是你不是在上面导入
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>7.3.1</version>
</dependency>
然后你还加入了插件就是在下面的
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>7.3.1</version>
<configuration>
<url>jdbc:sqlserver://localhost:1433;DatabaseName=xxxx</url>
<user>sa</user>
<password>xxxxxxxxx</password>
<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
</configuration>
</plugin>
出现上面的情况可能是你的springboot版本太高了,要么降低版本,要么就使用基于maven的插件
…坑啊