Hi, i am a new user trying out Gradle. I am writing a simple gradle build script where i build a set of Java sources. I am using gradle Java plugin that brings in a set of default tasks (like build, clean e.t.c)
I have defined dependencies like below which i wish to be included during compile time.
- include path to local libs /
dependencies {
compile fileTree(dir: ‘lib’, include: [’.*’])
}
This works for my default build task " ./gradlew build" where in it picks up all the dependent Jars from the lib folder during compile time.
However when i write a new Task ( i am writing as i want more than one Jars for my sources and each of the source folder/module has compile time dependancy on a set of Jars placed in lib folder)
For e.g; my new task is:
task myJarTask (type:Jar) {
println 'compiling myTask’
from sourceSets.myJarTask.output
classifier = "MyJar"
archiveName = “myJarTask.jar”
}
Question: when i do ./gradlew myJarTask it does not pick up compile time dependencies from the lib folder specified above. Is there a way i can specify where to look for compile time jars in Jar Task ?
Regards,
Ram