Thank’s a lot! This is the configuration that works for my case:
configurations {
jasperreports {
transitive = true
}
}
dependencies {
jasperreports 'net.sf.jasperreports:jasperreports:5.0.1'
}
task compileJasperJava(dependsOn: 'compileJava') << {
def jasperSourceDir = file('src/main/jasperreports')
def jasperTargetDir = file('build/classes/main/jasperreports')
ant {
taskdef(name: 'jrc', classname: 'net.sf.jasperreports.ant.JRAntCompileTask', classpath: configurations.jasperreports.asPath)
jasperTargetDir.mkdirs()
jrc(srcdir: jasperSourceDir, destdir: jasperTargetDir) {
classpath(path: sourceSets.main.output.classesDir)
include(name: '**/*.jrxml')
}
}
}
classes.dependsOn compileJasperJava