使用 Apache Ant

<target name="compile" description="Compiles report designs specified using the 'srcdir' in the &lt;jrc&gt; tag." depends="prepare-compile-classpath"> 
  <mkdir dir="./build/reports"/> 
    <taskdef name="jrc" classname="net.sf.jasperreports.ant.JRAntCompileTask"> 
        <classpath refid="project-classpath"/>
    </taskdef>
    <jrc 
            srcdir="./reports"
            destdir="./build/reports"
            tempdir="./build/reports"
            keepjava="true"
            xmlvalidation="true">
        <classpath refid="sample-classpath"/>
        <include name="**/*.jrxml"/>
    </jrc>
</target>

需要在系统上正确安装 Apache Ant 构建工具