Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

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

Closed
scottescue opened this issue Feb 20, 2014 · 1 comment · Fixed by #11
Closed

Comments

@scottescue
Copy link

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.

@alexnederlof
Copy link
Owner

I haven't worked with Scriplets so thats why they are not part of the plug-in. The goal of the plug-in was to speed up the reports I had to compile, not to be compliant with everything Jasper offers.

That being said I more then welcome pull requests as you can see from the pull request history. I do not think adding a classloader will have a significant impact on performance so I encourage you to go ahead and give it a try. If the code looks good I'd be happy to merge it and ship a new release.

Thanks for contributing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants