在我的项目中,我使用 Maven 3.0.4 和 JasperReports 5.1.0。要编译 JRXML 文件,请使用 jasperreports-maven-plugins。我有版本 1.0-beta-2 的 jasperreports-maven-plugin。由于它是测试版 (1.0-beta-2) 我可以知道,什么是稳定版本的 jasperreports-maven-plugin 可以使用?
在我的 pom.xml 文件中使用的插件下方
<properties>
<jasperreports.version>5.1.0</jasperreports.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<configuration>
<sourceDirectory>src/main/resources/reports</sourceDirectory>
<outputDirectory>${project.build.directory}/classes/reports</outputDirectory>
</configuration>
<executions>
<execution>
<!-- Need to bind to the compile phase cuz the reports uses classes under target/classes. The default is the generate-resources phase. -->
<phase>compile</phase>
<goals>
<goal>compile-reports</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>${jasperreports.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
最佳答案
忘记官方的 maven 插件吧。我一直在用 alexnederlof's Jasper report maven plugin很长一段时间,就像一个魅力。
您可以在 github 上找到更多信息:
The original jasperreports-maven-plugin from org.codehaus.mojo was a bit slow. This plugin is 10x faster. I tested it with 52 reports which took 48 seconds with the original plugin and only 4.7 seconds with this plugin.
并在他的 blog :
The original plug-in is created in Java 4, works single-threaded and the last time any committed to the repo was (at time of writing) 31st of August, 2009. Not really an active project it seems.
关于maven - jasperreports-maven-plugin 的稳定版本是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18495377/