springboot整合flyway出现Correct the classpath of your application so that it contains a single,compatibl

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的插件

…坑啊

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值