maven - 如果默认情况下禁用了构建缓存,gradle守护程序有哪些优势?

标签 maven caching gradle

我正在查看gradle上的文档,并且正在寻找它发现时可能引起的问题。 7.5.5. What can go wrong with Daemon?

该声明最重要的是:

It is also possible to destabilize the Daemon (and build environment in general) by running builds that do not release resources correctly. This is a particularly poignant problem when using Microsoft Windows as it is less forgiving of programs that fail to close files after reading or writing.



然后我看到By default, the build cache is not enabled.与以下语句非常矛盾:

The Daemon is a long-lived process, so not only are we able to avoid the cost of JVM startup for every build, but we are able to cache information about project structure, files, tasks, and more in memory.



在这里找到:7.1. Why the Gradle Daemon is important for performance

后来我运行gradle build --scan并确认缓存实际上已禁用。实际上,唯一启用的守护进程开关是守护进程。

因此,据我了解,使gradle作为构建工具更快的是其缓存先前构建的能力,但是默认情况下它是禁用的,因此除非启用缓存,否则它实际上与mvn clean install -DskipTests一样,在构建性能方面也是如此。

最佳答案

您的报价:

The Daemon is a long-lived process, so not only are we able to avoid the cost of JVM startup for every build, but we are able to cache information about project structure, files, tasks, and more in memory.



几乎可以回答您的问题。那是在谈论元数据,而不是缓存实际生成的文件内容。重复构建一个项目以测试较小的更改时,它仍然对速度有很大帮助。

关于maven - 如果默认情况下禁用了构建缓存,gradle守护程序有哪些优势?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48148147/

相关文章:

maven:如何清理本地仓库中的旧快照?

java - IntelliJ 无法从本地 Maven 存储库加载源

java - 如何从 Gradle 中的依赖项中排除内部包(不是 Maven 依赖项)

maven - 如何安装Eclipse Ditto

Python 数组缓存与 C 数组缓存

ios - AFNetworking 3.0 GET/POST 设置可接受的内容类型并清除图像缓存

java - 导入android.support.v4.app.ActivityCompat;

Haskell: "cache"如何友好是 Lazy Eval/按需调用

android - Android Studio:由于gradle分发网址错误而无法构建应用

android-studio - 当版本不匹配时,如何从 Android Studio 的命令行运行 gradle?