Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make ANT verbose?

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> 
like image 497
sproketboy Avatar asked Apr 07 '12 10:04

sproketboy


People also ask

How do you run Ant in verbose mode?

To run Ant build in debug or verbose mode in command prompt, we can simply use the -d or -debug (for debug mode) and -verbose (for verbose mode). This gives us deep insight into any error we might be facing with the Ant build.

How do you debug an Ant command?

Open the Ant view (Window -> Show view -> Ant). If the build file isn't in the view then you can simply add it. Once added right click on the ant target you want to run and select Debug as -> Ant build. The Debug perspective should open up and the process should stop at your breakpoint where you can step through it.

How do I run a specific target in Ant?

To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.

How to get extended (verbose) build output in ant?

You need to manually add the words "-verbose" or "-debug" to the ant command line. Sorry for not being more descriptive . When i add an new run/debug configuration and choose "Application " from the menu and then press run , i want to see extended (verbose) build output , i never generated an ant build file

Is there a verbose method for <target> and <project> in ant?

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? Show activity on this post.

How do I run ant from the command-line?

If you've installed Apache Ant as described in the Installing Ant section, running Ant from the command-line is simple: just type ant. When no arguments are specified, Ant looks for a build.xml file in the current directory and, if found, uses that file as the build file and runs the target specified in the default attribute of the <project> tag.

How do I find a specific build file in ant?

If you use the -find [file] option, Ant will search for a build file first in the current directory, then in the parent directory, and so on, until either a build file is found or the root of the filesystem has been reached. By default, it will look for a build file called build.xml.


2 Answers

To enable verbose output for ant:

ant -v 

or

ant -verbose 
like image 66
samlewis Avatar answered Oct 07 '22 01:10

samlewis


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! :)

like image 25
Gustavo Coelho Avatar answered Oct 07 '22 01:10

Gustavo Coelho