相关文章推荐
温暖的遥控器  ·  Java ...·  6 天前    · 
低调的马克杯  ·  kotlin-reflect ...·  1 周前    · 
儒雅的钢笔  ·  Unreal4 C++ ...·  1 周前    · 
逆袭的山寨机  ·  Use runtime and ...·  1 周前    · 
豁达的企鹅  ·  [解决]C# ...·  3 月前    · 
宽容的大熊猫  ·  Mounting a Single ...·  9 月前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I would like to get verbose console output while building from eclipse and hudson.

There seems to be no verbose property for <target> and <project> and it seems very wrong to call <exec> on ant from inside the script just to pass the verbose prop.

Is there a better way?

You could use Ant's <record> task ( http://ant.apache.org/manual/Tasks/recorder.html ) to get verbose logging to a file. If this task is defined early in the build file, you should get logging for all build tasks. You could also start and stop the recorder anywhere in your build file. This could, for example, allow you to not log the output of some task that you do not want to see in the log file.

Here's an example of a simple build file that uses the <record> task:

<?xml version="1.0" encoding="UTF-8"?>
<project default="all" basedir=".">
  <record name="build.log" loglevel="verbose" action="start" />
  <target name="all">
    <path id="all.files">
      <fileset dir="." includes="**/*" />
    </path>
    <property name="files" refid="all.files" />
    <echo level="verbose">files=${files}</echo>
  </target>
</project>
                Note: If you get the error "Problems opening file using a recorder entry", this may simply mean that the folder you're trying to save your log file in doesn't exist yet.
– Brad Parks
                Feb 3, 2014 at 17:59
                Thanks, adarshr, that worked fine in eclipse. a bit of a pain though to adjust it for every run config... hudson seems to launch ant with verbose flag per default
– kostja
                Mar 8, 2011 at 12:34
                External tools configurations -> Main -> Arguments: -verbose so tiny, I kept searching on google, I havent seen it...
– Aquarius Power
                Sep 18, 2016 at 18:29
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.