My Gradle project has a couple of maven dependencies. I don't want those included in my jar. It also has some dependencies on local jars. How can i include the classes from those in the output jar?
Asked
Active
Viewed 474 times
1 Answers
0
You can refer to a local repository (a directory in this case) with the following:
repositories {
ivy {
// URL can refer to a local directory
url "../local-repo"
}
}
To exclude the dependent jars from your final jar, you can use the compile configuration like this:
compileOnly files('libs/jgrapht-jdk1.6.jar')
compile 'org.simpleframework:simple-xml:2.7'
A more detailed answer can be seen over here: Gradle dependencies local jar file