Insane Programming Java ramblings and finds on the net

2Jun/100

Compiling JasperReports with Maven

For those working with JasperReports, this is the plugin config you can use to compile jrxml files:

...
<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
        <resource>
            <directory>target/generated-jasper</directory>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jasperreports-maven-plugin</artifactId>
            <version>1.0-beta-2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile-reports</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <outputDirectory>${project.build.directory}/generated-jasper</outputDirectory>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>net.sf.jasperreports</groupId>
                    <artifactId>jasperreports</artifactId>
                    <version>3.7.2</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
...

If you're using groovy as a template language in your JasperReport reports, don't forget to add the groovy-all 1.5.5 dependency to your plugin and add this to your plugin configuration:

<compiler>net.sf.jasperreports.compilers.JRGroovyCompiler</compiler>

Have fun reporting!

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


Spam protection by WP Captcha-Free

No trackbacks yet.