我有一个由 ANT 编译的 Web 项目。 *.jasper
文件与 *.class
文件一起编译。一旦迁移到 MAVEN,它们就不再与构建集成。
我尝试使用 resource maven 标签包含这些文件,但似乎只包含资源中的文件。我如何告诉maven将它们与*.class
放在一起(在同一文件夹中)?
最佳答案
您需要 Jasper 的 Maven 插件。我自己没有使用过,但这应该正是您所需要的 https://github.com/alexnederlof/Jasper-report-maven-plugin
按照使用说明进行操作
<build>
<plugins>
<plugin>
<groupId>com.alexnederlof</groupId>
<artifactId>jasperreports-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>jasper</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${project.build.directory}/jasper</outputDirectory>
</configuration>
</plugin>
</plugins>
你应该表现得很好!
更新 听起来您有一些配置需求,以更改源目录
<configuration>
<sources>
<source>src/main/java/</source>
</sources>
<outputDirectory>(same as your java output)</outputDirectory>
</configuration>
我相信这会对你有所帮助!
关于java - 如何将我的 *.jasper 文件与 *.class 文件一起包含在 Maven 构建中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18920756/