如何将 maven 的 antrun exec 命令的输出重定向到 stdout?
我正在使用 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>
虽然我可以在输出中看到 echo 语句,但我在标准输出中看不到任何可执行文件输出。我该怎么做才能将其重定向到回显消息所在的同一位置?
I'm using Maven 3.0.3. I have this antrun task, which uses the "exec" command ...
<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>
Although I can see the echo statement in my output, I can't see any of the executables output in standard out. What can I do to redirect it to the same place that the echo message goes to?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
spawn选项就是问题所在。请参阅 ant exec 任务文档:
此外,请确保不存在
output
或output property
,因为它们会将输出重定向到属性或文件(请参阅这个 stackoverflow 问题)。The spawn option is the problem. See the ant exec task documentation:
Furthermore, make sure there is no
output
oroutput property
present, as they will redirect the output to a property or file (see this stackoverflow question).