[英]System.out with Ant
I'm googling without success to figure out how to make ANT print System.out.println/System.out.print
messages in the console. 我正在谷歌搜索以弄清楚如何使ANT在控制台中打印
System.out.println/System.out.print
消息。 Messages simply don't appear. 消息根本不会出现。 I haven't found any simple way of doing this.
我还没有找到任何简单的方法来做到这一点。 Is there any?
有没有?
Thanks 谢谢
<echo message="Hello, world"/>
<echo message="Hello, file" file="logfile.txt" />
If you want to read the output from a <java>
task, use the outputproperty
attribute: 如果要读取
<java>
任务的输出,请使用outputproperty
属性:
<java ... outputproperty="javaoutput" />
<echo message="${javaoutput}" />
Another cause for not seeing standard output from your program is if you have forked the java process. 无法从程序中看到标准输出的另一个原因是您是否分叉了Java进程。
This will happen if you are using the Java task and have chosen to fork the execution to another VM: 如果您正在使用Java任务并选择将执行分叉到另一个VM,则会发生这种情况:
<java classname="com.example.MyClass" fork="true">
...
</java>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.