NetXMS Support Forum

English Support => General Support => Topic started by: Luis Montaño on February 13, 2019, 01:07:36 AM

Title: How to Create .jar files from jasper project
Post by: Luis Montaño on February 13, 2019, 01:07:36 AM
Hi everyone,
I have implemented netxms server with sql server 2016 and I have enabled reporting module. At the moment I can execute predefined report "Alarms Resolution time"
Also I have downloaded JasperStudio to create reports and I can view the report properly (On Jasper Studio Console). However, I would like to generate .jar file to integrate it with netxms.
I have seen some recomendation regarding use "maven package" command to generate .jar files. I have installed maven on windows but I realize that need a pom.xml file to make it wok properly.
Anyone  has a quick guide that I can follow?. I have seen that file (pom.xml) on java projects. It does mean that I have to use a java IDE like eclipse and jasper complement?.
What do you think would be the best way to do it?
Title: Re: How to Create .jar files from jasper project
Post by: Luis Montaño on February 13, 2019, 01:19:22 AM
Also I think that would be nice if we can have a standard repository/post where all can share their customized reports.
Title: Re: How to Create .jar files from jasper project
Post by: Alex Kirhenshtein on February 13, 2019, 05:26:17 PM
I use maven for that (see attached pom.xml).

buildUuid is used to distinguish between different reports, so if you want to see old runs of the report after changing report definition - uuid should remain the same.

Directory structure should be like this:

❯ tree
.
├── pom.xml
├── src
│   └── main
│       └── resources
│           ├── i18n.properties
│           └── main.jrxml


Entry point for the report should be main.jrxml, you can use $P{SUBREPORT_DIR} to reference images or subreprots.
Title: Re: How to Create .jar files from jasper project
Post by: Luis Montaño on February 13, 2019, 07:11:42 PM
Thanks, it works perfectly :D