简体   繁体   English

如何使 Gradle 7 在单个文件中保留依赖锁状态

[英]How to make Gradle 7 preserve dependency lock status in a single file

Gradle generates a dependency lock file for each subproject in a multi-module project. Gradle 为多模块项目中的每个子项目生成一个依赖锁文件。 Those lock files have a lot of duplicate dependencies.那些锁文件有很多重复的依赖。 Is there a way to preserve the lock status in a single lock file under the root project?有没有办法在根项目下的单个锁定文件中保留锁定状态?

The lock files are for internal use by gradle.锁定文件供 gradle 内部使用。 I wouldn't recommend touching them to be honest.老实说,我不建议触摸它们。 They have the lock files to save some infos about the dependencies.他们有锁定文件来保存有关依赖项的一些信息。 If you have the same dependency in multiple sub-projects you could try adding those to the root project gradle file;)如果您在多个子项目中具有相同的依赖项,您可以尝试将它们添加到根项目 gradle 文件中;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM