将JBoss AS 7库添加为Gradle依赖 [英] Adding JBoss AS 7 libs as Gradle Dependency
问题描述
我需要在我的项目中添加JBoss 7.1.1库作为 Gradle 依赖项,因为我需要它们在编译时。
但是我所有的依赖都是从Maven Repo添加的。
我见过如何来做到这一点,我可以使用 providedCompile 依赖项。 2012 / emulating-mavens-provided-scope-in-gradle /rel =nofollow>这个技巧就在这里。但是,我将它与什么关联?
如何将我在JBoss模块中的库添加为Gradle依赖项?
编辑
我已经看到我可以添加文件树到我的这样的依赖关系:
$ $ $ $ $ $ $ $ $ $提供了fileTree(dir:'myDir',include:'* .jar' )
}
但它不能递归地工作。它只添加了定义的文件夹
和JBoss AS 7.1.1,所有的模块都分割了 jars
,有什么办法可以引用整个模块文件夹,而不是每个特定的一个?
我想要做的就是这样,但它不是使用这种语法:
依赖关系{
提供了fileTree(dir:'%JBOSS_HOME%/ modules',include: '* .jar')
}
尝试以下操作:
依赖关系{
提供了fileTree(dir:'myDir',include:'** / * .jar')
}
这应该将所有.jar文件添加到' myDir'。
说明: *。jar 之前的
** /
code>告诉它递归检查.jar文件的所有目录。
I need to add JBoss 7.1.1 libs as a Gradle dependency in my project, because I need them in compile time.
But all the dependencies I have are added from a Maven Repo.
I have seen how to do it, I can add them as a providedCompile
dependency, using this technique right here. But what do I associate it to?
How do I add libs that I have in my JBoss Modules as a Gradle dependency?
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?
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'.
Explanation: The **/
before the *.jar
tells it to recursively check all directories for the .jar files.
这篇关于将JBoss AS 7库添加为Gradle依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!