GithubHelp home page GithubHelp logo

jasper-report-maven-plugin's People

Contributors

alexnederlof avatar ammachado avatar bwiedmann avatar cpolzer avatar css-inverso avatar denisfalqueto avatar gadton avatar jlleitschuh avatar lucarota avatar mattthebig avatar mmalmeida avatar nelsongraca avatar sohibegit avatar srbala avatar tan9 avatar tobiasrdm 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jasper-report-maven-plugin's Issues

Support Java 1.6

The plugin currently requires Java 1.7 for no special reason. It can be easy back-ported to Java 1.6, allowing it to be used by a broad range of legacy projects.

Provide Multiple Source Directories

I was wondering if there is a possibility to provide multiple source directories and have them compile to either multiple targets or a single one?

Failed to execute goal

Greetings,

I've followed the plugin configuration in my jasperreports project pom, when I do mvn clean install, i'm having this error message when executing the plugin in my project:

Failed to execute goal com.alexnederlof:jasperreports-plugin:2.0:jasper (default) on project:
Error while compiling Jasper reports: java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException: org.codehaus.groovy.control.CompilationFailedException -> [Help 1]

Any ideas for knowing whats going on?

Regards

Class com.jaspersoft.mongodb.MongoDbQueryExecuterFactory not found

When trying to compile a mongodb based report. I added

<dependency>
   <groupId>com.jaspersoft.connectors.mongodb</groupId>
   <artifactId>js-mongodb-datasource</artifactId>
   <version>2.0.1</version>
</dependency>
<dependency>
   <groupId>com.jaspersoft</groupId>
   <artifactId>com.jaspersoft.studio.data.mongodb</artifactId>
   <version>2.0.1</version>
</dependency>

whit its respective plugin repos.

Cannot compile on Java 8

Cannot compile on Java 8 because of ClassFormatException

[ERROR] [ERROR] Could not compile NoPageBreakReport.jrxml because Errors were encountered when compiling report expressions class file:
1. The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
                value = "  " + String.valueOf(((java.lang.Integer)variable_ShipCountryNumber.getValue())) + ". " + String.valueOf(((java.lang.String)field_ShipCountry.getValue())); //$JR_EXPR_ID=19$
                                                                                                                   <-------------------------------------------------------------->
1 errors

Could not compile CsvDataSourceReport.jrxml because Errors were encountered when compiling report expressions class file:
1. The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
                value = "  " + String.valueOf(((java.lang.Integer)variable_CityNumber.getValue())) + ". " + String.valueOf(((java.lang.String)field_city.getValue())); //$JR_EXPR_ID=12$
                                                                                                            <------------------------------------------------------->
1 errors

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
                value = "  " + String.valueOf(((java.lang.Integer)variable_ShipCountryNumber.getValue())) + ". " + String.valueOf(((java.lang.String)field_ShipCountry.getValue())); //$JR_EXPR_ID=19$
                                                                                                                   <-------------------------------------------------------------->

Java classes built in the same project/module are not accessible when compiling reports

I have several reports that use Scriptlet classes, which I would like to build in the same Maven module as my reports. The plugin doesn't seem to support this scenario currently.

I've tried configuring the plugin to run in either the 'compile' or 'process-classes' phase, while also setting the 'net.sf.jasperreports.compiler.classpath' to include the compiled Scriptlet classes, but the Scriptlet classes still aren't available on the classpath.

The Plugin Classloaders section of the Guide to Maven Classloading points out that the current project's build output is not available to the plugin by default. The only solution I can see is to do as the guide suggests and modify the plugin to build a new classloader that includes the project's compiled classes. This appears to be the same approach taken in the codehaus plugin.

I know improving the speed of report compilation is a main goal of the plugin, so I'm a little concerned about the performance impact of querying the project's classpath and creating a new classloader. I suggest adding a configuration flag that would enable the changes described above. Otherwise, the default classloader would continue to be used.

I'm ready to get started on a patch as long as you don't have objections and are willing to evaluate and merge a pull request.

Older versions of Jasper Reports

I'm working on a large project that uses jasperreports-3.7.0. Needless to say, your wonderful plugin won't work for me as-is.

I toyed with the idea of refactoring to treat the properties differently, depending on which API is available (3.7 doesn't have the DefaultJasperReportsContext, instead using JRProperties) - but that's terribly messy. Multiple ClassLoaders, or wiring up the DI - all require some runtime magic. And the tests would have to be enhanced to include older versions as well.

For now, I've forked this repo and am going to deploy a jasperreports-3.7.0 version into my private Nexus repo with a changed groupId. Not a great community-contributing way of dealing with it, but it'll get me moving forward.

I'd be happy to contribute something back here, if you have a suggestion that you think would work? Given the longevity of Jasper Reports, I can't imagine I'm the only one to have this need.

Why not jasperreports-maven-plugin?

Not a great question, but my obsessiveness couldn't leave it alone..

Given that you've followed the policy of releasing this with a new groupId and version, why not leave the artifactId?

Getting error probably due to the Jasper version.

My jasper files are compiling fine, but when I try to access one of them on the application I get a:

net.sf.jasperreports.engine.JRRuntimeException: Unknown hyperlink target 0

I did some research and concluded this happens due to the jasper version. Is there any sugestions about how to fix this?

This is a configuration snippet of jasperreports-plugin on my pom.xml:

<plugins>
    <plugin>
        <groupId>com.alexnederlof</groupId>
        <artifactId>jasperreports-plugin</artifactId>
        <version>2.0</version>
        <executions>
            <execution>
                <phase>process-sources</phase>
                <goals>
                    <goal>jasper</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
            <sourceDirectory>src/main/jasperreports</sourceDirectory>
            <outputDirectory>${project.build.directory}/classes/jasper</outputDirectory>
            <outputFileExt>.jasper</outputFileExt>
            <xmlValidation>true</xmlValidation>
            <verbose>false</verbose>
            <numberOfThreads>4</numberOfThreads>
            <failOnMissingSourceDirectory>true</failOnMissingSourceDirectory>
            <sourceScanner>org.codehaus.plexus.compiler.util.scan.StaleSourceScanner</sourceScanner>
            <additionalProperties>
                <net.sf.jasperreports.awt.ignore.missing.font>true</net.sf.jasperreports.awt.ignore.missing.font>
            </additionalProperties>
        </configuration>
    </plugin>
</plugins>

jasperreport plugin cannot resolve itext dependency

Hello, i am trying to use your plugin and i face an error i can't resolve. I created an empty project with this pom.xml :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mycompany</groupId>
    <artifactId>testIText</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
   <build>
	<plugins>
		<plugin>
			<groupId>com.alexnederlof</groupId>
			<artifactId>jasperreports-plugin</artifactId>
			<version>2.4</version>
			<executions>
				<execution>
					<phase>process-sources</phase>
	   				<goals>
	      					<goal>jasper</goal>
	   				</goals>
	   			</execution>
			</executions>
			<configuration>
				<!-- These are the default configurations: -->
				<compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
				<sourceDirectory>src/main/jasperreports</sourceDirectory>
				<outputDirectory>${project.build.directory}/jasper</outputDirectory>
				<outputFileExt>.jasper</outputFileExt>
				<xmlValidation>true</xmlValidation>
				<verbose>false</verbose>
				<numberOfThreads>4</numberOfThreads>
				<failOnMissingSourceDirectory>true</failOnMissingSourceDirectory>
				<sourceScanner>org.codehaus.plexus.compiler.util.scan.StaleSourceScanner</sourceScanner>
			</configuration>
		</plugin>
	</plugins>
</build>
</project>

So this is a classic pom.
And when i try to build the project i have this mistake :

--- maven-clean-plugin:2.5:clean (default-clean) @ testIText ---

--- jasperreports-plugin:2.4:jasper (default) @ testIText ---
The POM for com.lowagie:itext:jar:2.1.7.js6 is missing, no dependency information available
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.040 s
Finished at: 2018-10-02T11:02:28+02:00
------------------------------------------------------------------------
Failed to execute goal com.alexnederlof:jasperreports-plugin:2.4:jasper (default) on project testIText: Execution default of goal com.alexnederlof:jasperreports-plugin:2.4:jasper failed: Plugin com.alexnederlof:jasperreports-plugin:2.4 or one of its dependencies could not be resolved: Failure to find com.lowagie:itext:jar:2.1.7.js6 in http://maven.repository.redhat.com/techpreview/all was cached in the local repository, resolution will not be reattempted until the update interval of jboss-ga-plugin-repository has elapsed or updates are forced -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

I am using maven 3.5.4 and java 1.8.0_181

So do you have already encountered this problem or is this new ? And do you have any idea how it could be resolved ?

Custom fonts is not available to the JVM

I'm using the plugin to compile the Jasper reports XML files using as based on the configuration below

com.alexnederlof jasperreports-plugin 2.0 process-sources jasper net.sf.jasperreports.engine.design.JRJdtCompiler src/main/resources/jasperreports src/main/resources/jasperreports .jasper true false 4 true org.codehaus.plexus.compiler.util.scan.StaleSourceScanner
	<additionalProperties>
		<net.sf.jasperreports.awt.ignore.missing.font>true</net.sf.jasperreports.awt.ignore.missing.font>
		<net.sf.jasperreports.default.pdf.font.name>Courier</net.sf.jasperreports.default.pdf.font.name>
		<net.sf.jasperreports.default.pdf.encoding>UTF-8</net.sf.jasperreports.default.pdf.encoding>
		<net.sf.jasperreports.default.pdf.embedded>true</net.sf.jasperreports.default.pdf.embedded>
	</additionalProperties>

</configuration>

but on the runtime I'm getting error that the custom font "is not available to the JVM", I'm using maven and already set its dependency to the pom file, and the reports refer to it.

regards,

Do you use any lifecycleMappingMetadata for m2e configuration of this plugin?

When this plugin in in a project in Eclipse with m2e, Eclipse will complain that "Plugin Execution not covered by lifecycle configuration".

Reason for this is here - https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

You can set the lifecyclemappingmetadata to ignore this plugin (see below) which (correct me if I'm wrong), will prevent for example that if you bind the jasper goal to "compile", Eclipse will run the plugin's jasper goal when compiling the project.

I was wondering if other users have managed to create lifecycleMappingMetadata to bind the plugin to m2e's execution. If so, it might be useful to add to the plugin's documentation!

Example m2e mapping configuration that ignores this plugin:

<plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            com.alexnederlof
                                        </groupId>
                                        <artifactId>
                                            jasperreports-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.9,)
                                        </versionRange>
                                        <goals>
                                            <goal>jasper</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>

Maven Compiler Plugin 3.8.0 incompatibility

Similar to #46 but I'm attempting to update this plugin without downgrading Maven:

Failed to execute goal com.alexnederlof:jasperreports-plugin:2.4:jasper (default) on project base: The plugin com.alexnederlof:jasperreports-plugin:2.4 requires Maven version 3.5.0

Question about classpath

Hi,

I've written java classes to use jasperreport-function. In the same project I'm using maven and your pluging. I need to add the jasperreports-function to the classpath of the plugin.

<groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports-functions</artifactId> <version>6.10.0</version>

Any ideas who to proceed?

I've been trying to use the classpath configuration of the plugin, but can't seem to make it work. Any idea in how to proceed?

<plugin> <groupId>com.alexnederlof</groupId> <artifactId>jasperreports-plugin</artifactId> <version>2.3</version> <configuration> <sourceDirectory>${project.basedir}/src/main/jasperreports</sourceDirectory> <outputDirectory>${project.build.outputDirectory}/jasperreports</outputDirectory> <verbose>true</verbose> <classpathElements><element>net.sf.jasperreports.jasperreports-functions</element></classpathElements> </configuration> </plugin>

How add other custom project dependency to this plugin

Our Jrxml is depends on couple of my other java project, how to refer those project in this plugin? plugin dependency won't work with process-source phase, if phase is changed to process-class then its working but compiled jasper is not becoming a part of jar

Print report hangs

I am just a mare user of your plugin, I haven't created the report files therefore the report files used to reproduce this bug might not be done correctly. Non the less, I think the code should never end up in an endless loop.

Code location: JRVerticalFiller.fillColumnBand

while(band.willOverflow()) {
            this.fillColumnBreak(evaluation, evaluation);
            printBand = band.fill(this.columnFooterOffsetY - this.offsetY);
            this.fillBand(printBand);
            this.offsetY += printBand.getHeight();
}

If this is the wrong address for this bug please let me know. Thank you.

Unable to include project's classpath

It seems like unable to add the compile classpath to this plugin classpath. All the project's dependencies are not included in this plugin classpath. I tried maven-antrun-plugin to write the classpath string to a property, and then attempt to add it to the plugin's configuration, but it didn't work
< classpathElements>
< element>${maven.classpath}< /element>
< /classpathElements>
I'm using maven 3.1.1. jasperreports-plugin:1.6, java:1.7

Previous working project cannot be compiled on 1.8

[ERROR] Failed to execute goal com.alexnederlof:jasperreports-plugin:1.8:jasper (compile-jasperreports-reports) on project xyz-webapp: Error while compiling Jasper reports: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory -> [Help 1]

Change plugin version from 1.8 to 1.7, and everything works fine again.

Adoption

I am using this plugin at work. Having some dependency problems with it now, and would like to fix them.
Therefore I am interested in adoption of this plugin @alexnederlof

Compile is skipped when source and output folder are the same

I am looking at your plugin as a substitute for the old jasperreports-maven-plugin. As you tell, it is much faster than the old one, but I found that some things work very different from the old plugin.

My jrxml files are in a folder outside the classpath, and .jasper files must be in the same folder (Can't change that because of architecture reasons). I find the following issues with the plugin you are developing

a) If source and output folder are the same, then .jasper files are never generated. Plugin detects that there are files in the output folder, and skips compilation
b) If there is a single file in output folder, compilation is skipped as well.
c) Because of the same reason, there is no way I can do an incremental compile. That is, if a jrxml file is changed, it is not compiled when plugin is executed

I think that behaviour should be the same as with old plugin:
a) For each .jrxml file, find the compiled one with .jasper extension
b) If .jasper file does not exist, then compile
c) If .jrxml was modified after .jasper file, then compile

That behaviour could be the default one, or be activated by configuration.

Thanks in advance,
Roberto

Regression in xmlValidation option

The conversion to Mojo annotations introduced a bug in the xmlValidation option. The default value is supposed to be "true" but is instead "tue". For me, this causes SAXParser exceptions.

Workaround: explicitly set xmlValidation to "true" in your POM.

Compiling reports that use Java Beans on the same project

Hello, my reports use Java Beans that are on the same project, when I compile them with this plugin it saids that can not find this classes.

For example, one of my reports receives a parameter of type me.monge.virtual.reportes.SvgLogoWrapper (a class created by me) but then trying to compile it with this plugin, it saids:

me.monge.virtual.reportes.SvgLogoWrapper cannot be resolved to a type

Is there any recommended configuration for this to work? Thank you in advance.

Configuration option to always compile all files

Create configuration option to always compile all files. This is useful when sourceDirectory and outputDirectory are the same and the *.jrxml and *.jasper are already stored in the sources repository (SVN or Git). In that case when it is made a checkout, targetFile.lastModified() and sourceFile.lastModified() is the checkout timestamp.

The implementation can be performed using SimpleSourceInclusionScanner instead of StaleSourceScanner.

Compatible version for Apache Maven 3.0.5

I am getting the following error:
Failed to execute goal com.alexnederlof:jasperreports-plugin:2.3:jasper (default) on project : The plugin com.alexnederlof:jasperreports-plugin:2.3 requires Maven version 3.1.0 .

I am using Apache Maven 3.0.5 (Red Hat 3.0.5-17) and my pom.xml has the following:

<plugin> <groupId>com.alexnederlof</groupId> <artifactId>jasperreports-plugin</artifactId> <version>2.3</version> <executions> <execution> <phase>process-classes</phase> <goals> <goal>jasper</goal> </goals> </execution> </executions> <configuration> <compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler> <sourceDirectory>src/main/jasperreports</sourceDirectory> <outputDirectory>${project.build.outputDirectory}/jasper</outputDirectory> <outputFileExt>.jasper</outputFileExt> <xmlValidation>true</xmlValidation> <verbose>false</verbose> <numberOfThreads>4</numberOfThreads> <classpathElements> <element>${basedir}/target/classes</element> </classpathElements> </configuration> </plugin>

Default value for `outputDirectory` is not working since 1.7

Release 1.7 changed outputDirectory definition from

@parameter expression="${project.build.outputDirectory}/jasper"

to

@parameter property="${project.build.outputDirectory}/jasper"

This has a side effect of resolving default value to ${${project.build.outputDirectory}/jasper}, which is not exactly a convenient default. Tested with Maven 3.3.3 and plugin 1.6 (OK), 1.7, 1.8, 1.9 and 2.0.

Problem compiling Jasper with Lambda

Hi !
I have problem compiling jasper files that contain lambda... I use 2.6 version of plugin, I excluded your jasperreports dependencies, I added dependency to latest 6.11.0.

I also added this as additional properties:

1.8 1.8 1.8

But it seems to be ignored... I was able to compile the same files in my Java class without any problems...

maybe not threadsafe

when running maven with a -T option you get this error:

[WARNING] The following plugins are not marked @threadsafe in DI Webapplikasjon:
[WARNING] com.alexnederlof:jasperreports-plugin:1.9

Would it be possible to mark the plugin as threadsafe if it is that?

class not found on default configuration

I added your plugin with the basic configuration and I keep getting the following error:

[ERROR] Failed to execute goal com.alexnederlof:jasperreports-plugin:2.4:jasper (default) on project MonthEndReportsCore: Execution default of goal com.alexnederlof:jasperreports-plugin:2.4:jasper failed: A required class was missing while executing com.alexnederlof:jasperreports-plugin:2.4:jasper: org/codehaus/plexus/compiler/util/scan/mapping/SourceMapping
[ERROR] -----------------------------------------------------

By the way, the jar (plexus-api) with the required class and all other references are in my local repository(I checked one by one)

Broken dependencies

com.alexnederlof:jasperreports-plugin:jar:2.8 -> net.sf.jasperreports:jasperreports:jar:6.15.0 -> com.lowagie:itext:jar:2.1.7.js8
The latter is not on maven.
Even the latest version of jasperrports (6.20.0) depends on a version of itext not found on maven (2.1.7.js10). See here for an issue about that.

Does not support re-compilation

When I change something in jrxml file and need to redeploy application, I do

$ mvn clean install

But get folowing output, among the other lines:

[INFO] --- jasperreports-plugin:1.9:jasper (default) @ AisUiApp ---
[INFO] Nothing to compile - all Jasper reports are up to date

Hard Dependency on specific JasperReports Version

For example If one is to use lower version of JasperReports or Higher they can not. The fix is simple and is to make JasperReports as provided scope in plug-in pom.xml and let developers add the right JasperReports version.

Report generation fails with jasper 5.5.0

[ERROR] Failed to execute goal com.alexnederlof:jasperreports-plugin:1.7:jasper (default) on project pard-reports: Error while compiling Jasper reports: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory -> [Help 1]

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.