Reputation: 13450
Assuming my gradle dependencies are :
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'org.apache.commons:commons-io:1.3.2'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
How can I add them in a jar file which is being created with java
plugin and :jar
task?
I only found this solution for the libs but didn't work either.
See that I have both local dependencies and maven dependencies.
Upvotes: 0
Views: 140
Reputation: 123890
jar {
from { configurations.runtime.collect { zipTree(it) } }
}
Upvotes: 1