与文件目录的Gradle依赖关系 [英] Gradle dependencies with file directories
本文介绍了与文件目录的Gradle依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
在<$ c $的依赖项部分c> build.gradle 文件,您可以使用 FileTree
参考。例如:
依赖关系{
编译fileTree(dir:$ {jbossDir} / client '* .jar'])
}
这将包括所有JAR文件JBoss / client目录作为编译时依赖关系。
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.
解决方案
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'])
}
This will include all of the JAR files in the JBoss / client directory as compile-time dependencies.
这篇关于与文件目录的Gradle依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文