如何将maven的antrun exec命令的输出重定向到stdout?

Dav*_*ave 4 maven maven-antrun-plugin

我正在使用Maven 3.0.3.我有这个antrun任务,它使用"exec"命令...

        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
                <execution>
                    <id>start-xvfb</id>
                    <phase>process-test-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <echo message="Starting xvfb ..." />
                            <exec executable="Xvfb" spawn="true" failonerror="true">
                                <arg value=":0.0" />
                            </exec>
                        </tasks>
                    </configuration>
                </execution>
Run Code Online (Sandbox Code Playgroud)

虽然我可以在输出中看到echo语句,但我看不到标准输出中的任何可执行文件输出.我该怎么做才能将它重定向到echo消息所在的同一个地方?

谢谢, - 戴夫

Ale*_*hek 8

菌种的选择是问题.请参阅ant exec任务文档:

如果您生成一个命令,它的输出将不会被ant记录.

此外,请确保没有outputoutput property存在,因为它们会将输出重定向到属性或文件(请参阅此stackoverflow问题).