与文件目录的Gradle依赖关系 [英] Gradle dependencies with file directories

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

问题描述

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

解决方案

在<$ 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屋!

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