60

Trying to build my project with ANT in idea 10 and I get a compile error but I don't see the actual error.

How do I make ANT verbose?

All I see is:

javac build.xml:303: Compile failed; see the compiler error output for
details. at
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1150)
etc.... rest of ANT stack trace

My task looks like this:

<javac includeantruntime="false" destdir="${webapp.classes.dir}" debug="true">
    <src path="${src.dir}"/>
    <classpath refid="project.classpath"/>
</javac>
oers
  • 18,436
  • 13
  • 66
  • 75
sproketboy
  • 8,967
  • 18
  • 65
  • 95
  • [Maybe a dependency JAR missing?](http://stackoverflow.com/questions/8667798/compile-failed-see-the-compiler-error-output-for-details) – nobeh Apr 07 '12 at 10:14

4 Answers4

87

To enable verbose output for ant:

ant -v

or

ant -verbose
samlewis
  • 3,950
  • 27
  • 27
21

You can also enable logging on build.xml itself using task record. Here is documentation about it http://ant.apache.org/manual/Tasks/recorder.html

<record name="/output/build.log" loglevel="verbose" action="start"/>

It´s simple and works! :)

Gustavo Coelho
  • 960
  • 8
  • 6
  • 1
    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 18:00
2

There are also possibilities for subtler logging, means changing the noiselevel for specific parts only, not for the whole ant script as ant -v or ant -debug does. See Make ant quiet without the -q flag? for another question dealing with loglevel and answers.

Community
  • 1
  • 1
Rebse
  • 10,307
  • 2
  • 38
  • 66
1

You can also use the environment variable ANT_ARGS:

export ANT_ARGS="-verbose"

That applies even to ant builds executed via bash scripts.

dmatej
  • 1,518
  • 15
  • 24