I want to extract the file "default.jasperreports.properties" from the dependent jasperreports.jar and put it in the mail distribution with the new name "jasperreports.properties"
Gradle build example:
apply plugin: 'java' task zip(type: Zip) { from 'src/dist'
How to get FileTree in extractFileFromJar () from jasperreports-2.0.5.jar dependency?
In the script above I use
FileTree tree = zipTree('someFile.zip')
but want to use something like (wrong, but human readable)
FileTree tree = configurations.runtime.filter("jasperreports").singleFile.zipTree
PS: try to call
def extractFileFromJar(String fileName) { configurations.runtime.files.each { file -> println file}
but it does not work with an exception
You cannot change a configuration that is not in an unauthorized state!
source share