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

标签 java spring gradle spring-framework-beans

我对使用 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/

相关文章:

java - 如何让 logback 读取名称为变量的属性文件?

java - 如何在 Controller 中获取当前语言?

java - Maven 程序集插件使用类路径构建 jar

android - 错误 "Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0"当我做 gradle lint

gradle - Gradle Kotlin DSL 中的 kotlin ("...") 方法是什么?

java - 渐进图像

java - 在java中生成新变量

java - Martin Odersky 演讲中 Scala 编译器早期实现中的可重入性和静态数据。它们有何关系?

spring - 如何将使用消息监听器接收到的 JMS 消息转换为域对象

Gradle kotlin如何调用父级中定义的函数?