30

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?

kostja
  • 60,521
  • 48
  • 179
  • 224

2 Answers2

36

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>
Go Dan
  • 15,194
  • 6
  • 41
  • 65
  • 3
    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 03 '14 at 17:59
23

It will be an eclipse External Tools Configuration parameter (under Run -> External Tools). Please see the screenshot below:

enter image description here

Peter S.
  • 173
  • 1
  • 1
  • 10
adarshr
  • 61,315
  • 23
  • 138
  • 167
  • 2
    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 08 '11 at 12:34
  • `External tools configurations -> Main -> Arguments: -verbose` so tiny, I kept searching on google, I havent seen it... – Aquarius Power Sep 18 '16 at 18:29