【问题标题】:Task output caching is enabled, but no build caches are configured or enabled任务输出缓存已启用,但未配置或启用构建缓存
【发布时间】:2018-10-19 02:15:00
【问题描述】:

我已配置buildCache {} 部分启用远程缓存,但日志显示

已启用任务输出缓存,但未配置或启用构建缓存

我错过了什么?

【问题讨论】:

  • 您能否从您的构建文件中添加提取物,以便我们有机会查看可能出现的问题?

标签: gradle gradle-plugin gradle-cache


【解决方案1】:

在启用构建缓存但both the local and remote caches are disabled 时记录此警告。

您是否无意中以某种方式禁用了它们,例如通过一些没有按预期工作的isCiServer 逻辑?你能分享你的 buildCache 配置吗?

在您的 settings.gradle 中添加如下内容(为您的缓存实例添加适当的 url):

ext.isCiServer = System.getenv().containsKey("CI")

buildCache {
    local {
        enabled = !isCiServer
    }
    remote(HttpBuildCache) {
        url = 'https://example.com:8123/cache/'
        push = isCiServer
    }
}

或者添加

org.gradle.caching=true

发送至您的gradle.properties,或

--build-cache

到您的命令行应该足以让构建缓存正常工作。

【讨论】:

    猜你喜欢
    • 2018-11-03
    • 1970-01-01
    • 1970-01-01
    • 2012-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-29
    • 2023-03-08
    相关资源
    最近更新 更多