Here is a complete example that solves problems with Eclipse m2e reporting errors with the maven configuration, has reports that are clearly installed in a separate folder, and has class configurations.
Just remember to put your .jrxml files in the src / main / jasperreports folder and you are set up - every time you change the report, the jasper files will be restored.
pom.xml:
<properties> <jasperreports.version>5.0.0</jasperreports.version> </properties> <build> <pluginManagement> <plugins> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>org.codehaus.mojo</groupId> <artifactId>jasperreports-maven-plugin</artifactId> <versionRange>[1.0-beta-2,)</versionRange> <goals> <goal>compile-reports</goal> </goals> </pluginExecutionFilter> <action> <execute /> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> <sourceDirectory>src/main/java</sourceDirectory> <resources> <resource> <directory>src/main/java</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> <resource> <directory>src/main/resources</directory> </resource> <resource> <directory>target/jasper</directory> </resource> <resource> <directory>src/main/jasperreports</directory> </resource> </resources> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jasperreports-maven-plugin</artifactId> <configuration> <outputDirectory>${project.build.directory}/jasper</outputDirectory> </configuration> <executions> <execution> <goals> <goal>compile-reports</goal> </goals> <phase>generate-sources</phase> </execution> </executions> <dependencies> <dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>jasperreports-maven-plugin</artifactId> <version>1.0-beta-2</version> <exclusions> <exclusion> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> <version>${jasperreports.version}</version> </dependency> <dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>4.2.0</version> </dependency> </dependencies> </plugin> </plugins> </build> ...
source share