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

后端 未结 2 1224
时光取名叫无心
时光取名叫无心 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:34

    The thing causing it is the spring-boot-dependencies-1.3.3.RELEASE.pom

    This forcing the flyway version to 3.2.1

    According to the Spring Boot docs you should be able to add a line like this to your build.gradle: ext['flyway.version'] = '4.0.1'

    0 讨论(0)
  • 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 :

    <flyway.version>3.2.1</flyway.version>
    ......
    <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
        <version>${flyway.version}</version>
    </dependency>
    

    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

    0 讨论(0)
提交回复
热议问题