Jasper Report issue Report design not valid & java.lang.ClassNotFoundException: Gradle -
i working on multimodule project , generating jasper reports using gradle anttask. using gradle ant task
my project structure is:-
`rootproject -a module-b ---> classes using here during jasper report generation. module-c ---> added ant task in build.gradle , .jrxml files in module. `
.jrxml files in module-c , when generating reports searching classes present in module-b. have defined classpath under anttask in module-c - classpath(path: sourcesets.main.output.classesdir)
wont able classess module-b. please advice how classes required while executing jaspertask
apply plugin: 'java' apply plugin: 'maven' apply plugin: 'war' group = 'org.c' version = '1.0.0' description = 'c module' sourcesets { main { java { srcdir 'src' } resources { srcdir 'resources' } } test { java { srcdir 'test' } } } sourcecompatibility = 1.6 targetcompatibility = 1.6 repositories { mavenlocal() //added other repositories per requirement } configurations { jasperreports { transitive = true } } gradle.projectsevaluated { processresources.dependson(compilejasperreports) } dependencies { jasperreports 'net.sf.jasperreports:jasperreports:5.6.0', 'org.codehaus.groovy:groovy-all:2.3.6' } task compilejasperreports { def jaspersourcedir = file('src/main/jasper') ant { taskdef(name:'jrc',classname:'net.sf.jasperreports.ant. jrantcompiletask',classpath:configurations.jasperreports.aspath)` sourcesets.main.output.classesdir = new file(builddir, "classes/main") sourcesets.main.output.classesdir.mkdirs() jrc(srcdir: jaspersourcedir, destdir:sourcesets.main.output.classesdir) { **classpath(path: sourcesets.main.output.classesdir)** //here need add classes directory of module-b classes--how add module-b classes .jrxml can access , generate report.. include(name: '**/*.jrxml') } } } dependencies { compile project(':b') //provided other dependencies per build needs. }
error:-
[ant:jrc] file : c:\users\test\desktop\project\c\src\main\jasper\test.jrxml ... failed. [ant:jrc] error compiling report design : c:\users\test\desktop\project\c\src\main\jasper\test.jrxml [ant:jrc] net.sf.jasperreports.engine.design.jrvalidationexception: report design not valid : [ant:jrc] 1. java.lang.classnotfoundexception: org.b.classname [ant:jrc] @ net.sf.jasperreports.engine.design.jrabstractcompiler.verifydesign(jrabstractcompiler.java
Comments
Post a Comment