Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用ant合并多个html文件_Java_Ant_Extentreports_Selenium Extent Report - Fatal编程技术网

Java 使用ant合并多个html文件

Java 使用ant合并多个html文件,java,ant,extentreports,selenium-extent-report,Java,Ant,Extentreports,Selenium Extent Report,我有许多并行运行的测试。每个测试生成一个扩展数据块报告文件,该文件是一个html文件 我看不出如何在测试结束时合并这些文件 所以我想这样做: file1.html: <body> content-1 </body> 内容-1 file2.html <body> content-2 </body> 内容-2 结果应该是这样的: merge.html <body> content-1

我有许多并行运行的测试。每个测试生成一个扩展数据块报告文件,该文件是一个html文件

我看不出如何在测试结束时合并这些文件

所以我想这样做:

file1.html:

<body>
      content-1
</body>

内容-1
file2.html

<body>
      content-2
</body>

内容-2
结果应该是这样的:

merge.html

<body>
      content-1
      content-2
</body>

内容-1
内容-2
你有一个聪明的方法吗?


<?xml version="1.0" encoding="UTF-8"?>
<project default="concat" name="My Project">

    <property name="filesToMerge" value="/home/guest/Desktop/" />
    <property name="mergeFile" value="/home/guest/Desktop/merge.html" />

    <target name="concat">
        <concat destfile="${mergeFile}">
            <header filtering="no" trim="no" trimleading="yes">
                &lt;body&gt;
            </header>
            <fileset dir="${filesToMerge}" />
            <filterchain>
                <linecontains negate="true">
                    <contains value="&lt;body&gt;" />
                </linecontains>
                <linecontains negate="true">
                    <contains value="&lt;/body&gt;" />
                </linecontains>
            </filterchain>
            <footer filtering="no" trim="yes" trimleading="yes">
                &lt;/body&gt;
            </footer>
        </concat>
    </target>
</project>
身体 /身体