NerdGerl

JasperReports and Maven

Posted by: nerdgerl on: August 12, 2009

Simply add the dependency and plugin to your pom as follows:

<build>
	<plugins>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>jasperreports-maven-plugin
			</artifactId>
			<configuration>
				<outputDirectory>target/jasperreports
				</outputDirectory>
			</configuration>
			<executions>
				<execution>
					<goals>
						<goal>compile-reports</goal>
					</goals>
				</execution>
			</executions>

			<dependencies>
				<!--
					note this must be repeated here to pick up correct xml validation
				-->
				<dependency>
					<groupId>jasperreports</groupId>
					<artifactId>jasperreports</artifactId>
					<version>3.5.3</version>
				</dependency>
			</dependencies>
		</plugin>
	</plugins>
</build>

You can then compile the jrxml files using the following command:

jasperreports:compile-reports

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.