【问题标题】:Gradle use correct version of dependencyGradle 使用正确版本的依赖项
【发布时间】:2019-07-02 15:25:36
【问题描述】:

目前我的项目需要Cassandra作为数据库,所以我使用了org.springframework.data:spring-data-cassandra:2.1.9.RELEASE作为解决方案,我也使用了spring-security-core 5.1.5作为解决方案,但在 spring-security-core 5.1.5 中,它似乎具有 org.springframework.data:spring-data-cassandra:2.1.6.RELEASE 依赖项。

所以我想知道如何在 IDEA 的 gradle 中解决这个问题。

【问题讨论】:

    标签: java gradle intellij-idea


    【解决方案1】:

    我建议您在任何地方都使用 cassandra:2.1.6 以避免版本冲突。我认为您不必重写代码的任何部分。

    或者您可以尝试删除 2.1.6 版本 compile.exclude 组:'com.example.x',模块:'x'

    但这可能会导致 spring-security 工作不稳定。所以第一个解决方案更可取。

    【讨论】:

      【解决方案2】:

      我建议在 spring-security-core 5.1.5 中排除 org.springframework.data:spring-data-cassandra:2.1.6.RELEASE

      参考此链接如何排除 - https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/ModuleDependency.html#exclude-java.util.Map-

      【讨论】:

        猜你喜欢
        • 2015-03-29
        • 2016-11-30
        • 2023-04-01
        • 1970-01-01
        • 2017-01-25
        • 2017-08-21
        • 1970-01-01
        • 2018-06-02
        • 2019-07-23
        相关资源
        最近更新 更多