gpt4 book ai didi

java - 如何仅使用本地目录作为存储库在 gradle 上设置 springframework?

转载 作者:太空宇宙 更新时间:2023-11-04 10:15:21 25 4
gpt4 key购买 nike

我对使用 gradle 和 springframework 都很陌生。

如何在不使用任何外部存储库(包括本地 Maven 存储库)的情况下使用 springframework 作为 gradle 插件?即只需使用下载的 springframework 文件,将它们放在我的本地目录中并告诉 gradle 引用它们。

最佳答案

您可能正在寻找Flat directory repository :

Some projects might prefer to store dependencies on a shared drive or as part of the project source code instead of a binary repository product.

例如,在 build.gradle 中添加:

repositories {
flatDir {
dirs 'lib'
}
flatDir {
dirs 'lib1', 'lib2'
}
}

This adds repositories which look into one or more directories for finding dependencies. Note that this type of repository does not support any meta-data formats like Ivy XML or Maven POM files. Instead, Gradle will dynamically generate a module descriptor (without any dependency information) based on the presence of artifacts. However, as Gradle prefers to use modules whose descriptor has been created from real meta-data rather than being generated, flat directory repositories cannot be used to override artifacts with real meta-data from other repositories. For example, if Gradle finds only jmxri-1.2.1.jar in a flat directory repository, but jmxri-1.2.1.pom in another repository that supports meta-data, it will use the second repository to provide the module.

关于java - 如何仅使用本地目录作为存储库在 gradle 上设置 springframework?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51784883/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com