DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • File Upload Security and Malware Protection
  • Top 10 Pillars of Zero Trust Networks
  • Merge GraphQL Schemas Using Apollo Server and Koa
  • Unlocking the Power of AIOps: Enhancing DevOps With Intelligent Automation for Optimized IT Operations

Trending

  • File Upload Security and Malware Protection
  • Top 10 Pillars of Zero Trust Networks
  • Merge GraphQL Schemas Using Apollo Server and Koa
  • Unlocking the Power of AIOps: Enhancing DevOps With Intelligent Automation for Optimized IT Operations
  1. DZone
  2. Coding
  3. Java
  4. Integrating BIRT into Your Maven Build - A Work In Progress

Integrating BIRT into Your Maven Build - A Work In Progress

Mark Clarke user avatar by
Mark Clarke
·
Aug. 24, 09 · Interview
Like (1)
Save
Tweet
Share
27.76K Views

Join the DZone community and get the full member experience.

Join For Free

When ever I undertake a project I always looks for an opportunity to use at least one new technology so as to continually increase the number of tools I have in my toolbox, so for a recent project I took the opportunity to use BIRT, the Eclipse's reporting engine. In the past, before Birt was available, I had made use of JasperReports. The biggest challenge I found with Jasper Reports at the time was the visual report designer. Although there was a GUI designer available,namely iReports, it wasn't the greatest, this might have changed, but this was one of my biggest reasons for deciding to use BIRT.

I am happy to say that report creation with BIRT was a breeze, with a few clicks of the button, one can generate a decent looking report. However I didn't get the afternoon off. Instead I had to struggle to try and integrate BIRT into my web application. The two challenges I faced were:

  1. Integrating the BIRT dependencies into a maven build process, and
  2. Integrating the runtime engine into your application

Maven and BIRT Dependencies

Basicaly BIRT has not been mavenised. For one, the BIRT dependencies are not readily available in the maven2 public repositories and secondly finding a complete list of dependencies was a challenge. There are a few dependencies, so having to download and then install the dependencies in your own local repository, although an option, can be painful. Luckily the kind folks at JBoss have a maven repository with the Birt core dependencies. So first you will need to add an entry for the JBoss maven repo to your pom.xml.

 <repositories>
<repository>
<id>JBoss</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>http://repository.jboss.org/maven2</url>
</repository>
.....
</repositories>



Then you need to add the BIRT dependencies. Currently the JBoss repo does not have the latest BIRT 2.5.0 dependencies. I assume this is because Eclipse 3.5, with BIRT 2.5.0 has just come out and they will be added in due course.  First I set a property to the version of BIRT I am using.

 

 <properties>
<birt.version>2.3.2</birt.version>
</properties>

Then reference this in the pom dependencies section.

<dependencies>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>chartengineapi</artifactId>
<version>${birt.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>coreapi</artifactId>
<version>${birt.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>dataadapterapi</artifactId>
<version>${birt.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>engineapi</artifactId>
<version>${birt.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>modelapi</artifactId>
<version>${birt.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>scriptapi</artifactId>
<version>${birt.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>dteapi</artifactId>
<version>${birt.version}</version>
</dependency>

<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>3.8.1</version>
</dependency>

<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.6R7</version>
</dependency>

<dependency>
<groupId>apache-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
......
</dependencies>


There may be more dependencies depending on the export format that you use. I only made use of PDF format for the reports. If you find other dependencies please add them in the comments. The last two dependencies where a bit more difficult to track down but they are available in the JBoss repo. For 2.5.0 you may have to experiment, of google, for the correct versions of these jars. With the above you can now happily compile your web app, but it won't run as you have not included the BIRT runtime dependencies. BIRT is an OSGI application and as such requires a stripped down version of the OSGI runtime to work.

How to Include BIRT OSGI Runtime Requirements?

The BIRT OSGI runtime has over 116 dependencies! Besides the large number of dependencies, the runtime files need to be in specific directories, namely plugins and configuration, as well. Although I am sure there is a smart way to do this with maven, that is a bit beyond my current maven skill level. The solution I used was to copy the two directories from the matching runtime archive, to the WEB-INF directory. The war plugin then automatically copies the runtime over as part of the war plugin packaging process.

Help With The Documentation

If anyone has some tips on how better to integrate BIRT with Maven, please let me know. 

Apache Maven Dependency Build (game engine)

Opinions expressed by DZone contributors are their own.

Trending

  • File Upload Security and Malware Protection
  • Top 10 Pillars of Zero Trust Networks
  • Merge GraphQL Schemas Using Apollo Server and Koa
  • Unlocking the Power of AIOps: Enhancing DevOps With Intelligent Automation for Optimized IT Operations

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: