[英]Adding folder containing jars in java multimodule project
I am a newbie in Gradle and I have the following java project structure: 我是Gradle的新手,并且具有以下Java项目结构:
rootProject
|--- projectA
|-------src/main/java
|-------build.gradle
|--- Lib
|-------lib/*.jar
|--- build.gradle
|--- settings.gradle
I am trying to build projectA. 我正在尝试构建projectA。 Project A dependencies are in Lib/lib folder as jars.
项目A依赖项在jar / lib文件夹中为jar。 I know that it is better to download these jars from maven central but now I have to maintain this structure.
我知道最好从Maven Central下载这些jar,但是现在我必须保持这种结构。 So I am not aware how to add all the jars that are in Lib folder in projectA/build.gradle .
所以我不知道如何添加projectA / build.gradle的Lib文件夹中的所有jar。 Can anyone help?
有人可以帮忙吗?
My build.gradle file in projectA is the following 我在projectA中的build.gradle文件如下
apply plugin : "java"
task listJars<< {
configurations.compile.each { File file -> println file.name }
}
dependencies{
compile fileTree(dir:'Lib/lib',include:'*.jar')
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.