带有文件目录的 Gradle 依赖项 [英] Gradle dependencies with file directories

查看:27
本文介绍了带有文件目录的 Gradle 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 jboss ear 应用程序编写 EJB jar 模块.我正在使用 gradle,我不想尝试从 JBoss 声明 jar 在运行时依赖的所有不同依赖项.有没有办法声明对目录树中所有文件的依赖关系.

I'm writing an EJB jar module for a jboss ear application. I'm using gradle and I don't want to try to declare all of the different dependencies that the jar would rely on at runtime from JBoss. Is there a way to declare dependencies on all files within a directory tree.

推荐答案

build.gradle 文件的依赖项部分,您可以使用 FileTree 参考.例如:

In the dependencies section of your build.gradle file you can use a FileTree reference. For example:

dependencies {
    compile fileTree(dir: "${jbossDir}/client", includes: ['*.jar'])
}

这将包含 JBoss/client 目录中的所有 JAR 文件作为编译时依赖项.

This will include all of the JAR files in the JBoss / client directory as compile-time dependencies.

这篇关于带有文件目录的 Gradle 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆