Why does Gradle downgrade my transitive dependencies in a Grails 3.1 application?

后端 未结 2 1230
时光取名叫无心
时光取名叫无心 2020-12-14 02:04

I am having a problem with a transitive dependency of my grails-flyway plugin. org.grails.plugins:grails-flyway:0.2.1 declares a dependency to

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-14 02:42

    Goto your Gradle cache files folder:

    cd ~/.gradle/caches/modules-2/files-2.1
    

    search this version number:

    grep -r "3.2.1" *
    

    you will find out which pom file is using this version, usually it's something in spring-boot-dependencies-x.y.z.RELEASE.pom :

    3.2.1
    ......
    org.flywaydb
        flyway-core
        ${flyway.version}
    
    

    which means, if you use spring-boot, it will overwrite some dependency version.

    you can overwrite it again, by adding the following line in your gradle.properties file:

    flyway.version=4.0.1
    

    I encounter a similar problem and wasted several hours on it. So I left this information here, hope this could save your time if you get stuck into this problem

提交回复
热议问题