简体   繁体   English

将JBoss AS 7库添加为Gradle依赖项

[英]Adding JBoss AS 7 libs as Gradle Dependency

I need to add JBoss 7.1.1 libs as a Gradle dependency in my project, because I need them in compile time. 我需要在项目中添加JBoss 7.1.1库作为Gradle依赖项,因为我在编译时需要它们。

But all the dependencies I have are added from a Maven Repo. 但我所拥有的所有依赖项都是从Maven Repo中添加的。

I have seen how to do it, I can add them as a providedCompile dependency, using this technique right here. 我已经看到了如何做到这一点,我可以在这里使用这种技术将它们添加为providedCompile依赖项。 But what do I associate it to? 但是我将它与什么联系起来呢?

How do I add libs that I have in my JBoss Modules as a Gradle dependency? 如何将我在JBoss模块中使用的库添加为Gradle依赖项?


EDIT 编辑

I have seen I can add a file tree to my dependencies like this: 我已经看到我可以向我的依赖项添加一个文件树,如下所示:

dependencies {
    provided fileTree(dir: 'myDir', include: '*.jar')
}

But it doesn't work recursively. 但它不能递归地工作。 It only adds the defined folder, and JBoss AS 7.1.1 has all the jars splitted in modules, is there any way I can reference the entire module folder, instead of each specific one? 它只添加了定义的文件夹,JBoss AS 7.1.1将模块中的所有jars分开,有没有什么方法可以引用整个模块文件夹,而不是每个特定的文件夹?

What I want to do is somehting like this, but it doesn't work with this syntax: 想要做的就是这样,但它不适用于这种语法:

dependencies {
    provided fileTree(dir: '%JBOSS_HOME%/modules', include: '*.jar')
}

Try the following: 请尝试以下方法:

dependencies {
    provided fileTree(dir: 'myDir', include: '**/*.jar')
}

This should add all .jar files in all subfolders of 'myDir'. 这应该在'myDir'的所有子文件夹中添加所有.jar文件。

Explanation: The **/ before the *.jar tells it to recursively check all directories for the .jar files. 说明: *.jar之前的**/告诉它以递归方式检查.jar文件的所有目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM