Giter Site home page Giter Site logo

gmazelier / gradle-jasperreports Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 20.0 192 KB

Provides the capability to compile JasperReports design files.

Home Page: https://plugins.gradle.org/plugin/com.github.gmazelier.jasperreports

License: Apache License 2.0

Groovy 100.00%
groovy jasperreports-plugin

gradle-jasperreports's People

Contributors

blaketastic2 avatar gmazelier avatar rankec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gradle-jasperreports's Issues

Question about compiling with a custom expression function

I've followed the following tutorial and have no problem compiling a .jasper file in the Jaspersoft Studio. https://community.jaspersoft.com/wiki/jaspersoft-studio-expression-editor-how-extend-it-and-contribute-your-own-functions-part-2-0

I've defined a custom function and now I'm moving the project to Intellij. I'm using your plugin to compile the jasper file. But running into errors that my function is not recognized. Any information in how to go ahead with this? I've tried adding jasperreport-functions as dependency, but no help. Any ideas?

Prevent report compilation from creating icon for Gradle daemon on MacOS dock

When the report compilation runs, it exposes a Java icon on the MacOS dock. When using the gradle daemon, the icon will stay as long as the gradle daemon is alive.

The compilation needs to set the -Dapple.awt.UIElement=true on whatever process is being forked to do the compilation.

Setting the global export JAVA_TOOL_OPTIONS="-Dapple.awt.UIElement=true" does fix the problem, but is probably not the best solution since some apps may want to be on the dock.

Classpath issues

I may be missing something silly here, but it looks like dependencies in the compile classpath are not used to execute the JasperCompileManager.

We are using some joda time classes in our reports, joda time is in the compile classpath, but we get the following sorts of errors:

    [InvoiceDepartment.jrxml] Errors were encountered when compiling report expressions class file:
  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  General error during class generation: java.lang.NoClassDefFoundError: groovyjarjarasm/asm/ClassWriter

  java.lang.RuntimeException: java.lang.NoClassDefFoundError: groovyjarjarasm/asm/ClassWriter
    at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1083)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1061)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:583)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:561)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:538)
    at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:109)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:201)
    at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:241)
    at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:157)
    at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:139)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:438)
    at net.sf.jasperreports.engine.JasperCompileManager$compileReportToFile$3.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
    at com.github.gmazelier.tasks.JasperReportsCompile$_execute_closure4_closure7.doCall(JasperReportsCompile.groovy:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
    at groovy.lang.Closure.call(Closure.java:423)
    at groovy.lang.Closure.call(Closure.java:439)
    at groovyx.gpars.pa.CallClosure.call(CallClosure.java:47)
    at groovyx.gpars.pa.ClosureMapper.op(ClosureMapper.java:36)
    at groovyx.gpars.extra166y.AbstractParallelAnyArray$OOMPap.leafTransfer(AbstractParallelAnyArray.java:2255)
    at groovyx.gpars.extra166y.PAS$FJOMap.atLeaf(PAS.java:258)
    at groovyx.gpars.extra166y.PAS$FJBase.internalCompute(PAS.java:118)
    at groovyx.gpars.extra166y.PAS$FJBase.compute(PAS.java:106)
    at jsr166y.RecursiveAction.exec(RecursiveAction.java:148)
    at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:305)
    at jsr166y.ForkJoinWorkerThread.execTask(ForkJoinWorkerThread.java:575)
    at jsr166y.ForkJoinPool.scan(ForkJoinPool.java:733)
    at jsr166y.ForkJoinPool.work(ForkJoinPool.java:617)
    at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:369)
  Caused by: java.lang.NoClassDefFoundError: groovyjarjarasm/asm/ClassWriter
    at net.sf.jasperreports.compilers.JRGroovyCompiler$ClassCollector.call(JRGroovyCompiler.java:160)
    at org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:814)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1047)
    ... 36 more

  1 error

    [InvoiceTitle.jrxml] Errors were encountered when compiling report expressions class file:
  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  calculator_InvoiceTitle_1421861925896_293545: 168: unable to resolve class org.joda.time.LocalDate
   @ line 168, column 22.
  calculator_InvoiceTitle_1421861925896_293545: 232: unable to resolve class org.joda.time.LocalDate
   @ line 232, column 22.
  calculator_InvoiceTitle_1421861925896_293545: 296: unable to resolve class org.joda.time.LocalDate
   @ line 296, column 22.
  3 errors

Is this a known issue? I was able to work around it for now by adding the joda time dependency to the buildscript classpath:

buildScript {
  dependencies {
    classpath "joda-time:joda-time:2.3"
  }
}

Problem with dependency

Hi @gmazelier

This plugin is so cool. Are you still maintaining this? I have a problem with this plugin, got this error:

image

Could this because the outdated dependencies or some broken repository urls?

Plugin is not working anymore with Gradle 8

I do plan to upgrade to Gradle 8.

During the configuration step I get the following exception:

An exception occurred applying plugin request [id: 'com.github.gmazelier.jasperreports', version: '0.4']
> Failed to apply plugin 'com.github.gmazelier.jasperreports'.
   > Could not create task ':compileAllReports'.
      > Cannot use @TaskAction annotation on method JasperReportsCompile.execute() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.

I have seen that IncrementalTaskInputs is deprecated in Version 7.6.1.

dependency issue

Hi,

i tried to use your plugin but i got:

Error:Could not find com.lowagie:itext:2.1.7.js2.
Searched in the following locations:
https://jcenter.bintray.com/com/lowagie/itext/2.1.7.js2/itext-2.1.7.js2.pom
https://jcenter.bintray.com/com/lowagie/itext/2.1.7.js2/itext-2.1.7.js2.jar
Required by:
:Netversys3:unspecified > com.github.gmazelier:jasperreports-gradle-plugin:0.1.0 > net.sf.jasperreports:jasperreports:5.2.0

in the jcenter repos there is no "2.1.7.js2" folder but only "2.1.7".

Plugin not correctly finding source/out directory for multi-project build

This is the work-around so that I could make my project work. Note that I had to be explicit with the build directory.

jasperreports {
  val packageDir = "org/naic/spl/gateway/reports"
  val myBuildDir = project(":gateway-jasper-reports").buildDir
  srcDir = file("$projectDir/src/main/jasperreports/$packageDir")
  tmpDir = file("$myBuildDir/jasperreports")
  outDir = file("$myBuildDir/classes/java/main/$packageDir")
  srcExt = ".jrxml"
  outExt = ".jasper"
  compiler = "net.sf.jasperreports.engine.design.JRJdtCompiler"
  keepJava = false
  validateXml = true
  verbose = false
  useRelativeOutDir = true
  classpath = files
}

classpath property not recognized

I tried the leaving untouched all of the default configuration property values, before I realized our classpath is not standard. So I tried replacing it, but I get:

No such property: classpath for class: com.github.gmazelier.plugins.JasperReportsExtension_Decorated

I even copy-pasted the default line on the project overview doc, and I get the same result.

Groovy language is not supported in report definition

Observed while reporting issue Classpath issues:

Change language in report definition from groovy to java to prevent the LinkageError or java.lang.NoClassDefFoundError: groovyjarjarasm/asm/ClassWriter error if groovy-all in not added in the buildscript configuration. It's a known workaround, see this comment on SO for example.

Documentation: tmpDir, outdir should use doubles quotes

There is an error in the documentation:

tmpDir = file('${project.buildDir}/jasperreports')
outDir = file('${project.buildDir}/classes/main')

This will create a directory called ${project.buildDir} in the project's main dir.

Example should use double quotes to specify tmpDir and outDir, in order to support String interpolation, replacing ${project.buildDir} with its value:

tmpDir = file("${project.buildDir}/jasperreports")
outDir = file("${project.buildDir}/classes/main")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.