【问题标题】:testCompile for Gradle dependencies用于 Gradle 依赖项的 testCompile
【发布时间】:2021-03-13 20:33:19
【问题描述】:

我需要 H2 DB 的 Gradle h2 依赖项。在 MVN 存储库中,我只看到 testCompile group: 'com.h2database', name: 'h2', version: '1.4.188'. 我读到 testCompile 用于测试,我不需要此依赖项进行测试,我只需要依赖项 \ 用于在我的 Spring Boot 应用程序中创建 H2 DB。我应该只对 H2 使用 testCompile 依赖还是应该有常规的编译依赖?

【问题讨论】:

    标签: database spring-boot gradle h2


    【解决方案1】:

    正确的做法是将以下常规编译依赖项添加到您的 build.gradle 文件中:

    compile "com.h2database:h2"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-03
      • 2016-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多