I have an existing project that I want to build in the IntelliJ Community Edition 11.1.4 running on Ubuntu 12.04.1 LTS
In the Ant Build window I added the project's build.xml
by clicking on the + button in the top left hand corner of the window and navigating to the file. The ant tasks associated with the build file are listed and I click on the green play button to run the ant build which commences as expected.
I was expecting to see compiler errors and have IntelliJ CE present those compiler errors and allow me to Jump to (the offending) Source having double clicked on the errors in the Messages window.
Instead, the messages window displays the following error which when I double-click on it takes me to the javac
ant task in the build.xml
file.
build.xml:389: Compile failed; see the compiler error output for details.
This is great advice and I very much want to follow it but I cannot because the compiler error is not displayed anywhere in the Messages window. Next and Previous Message do not navigate to an actual compiler error.
I want to know how to be able to see the compiler error messages in IntelliJ having run an Ant build.
I tried adding the -v flag to the Ant command line:field in Execution Properties. This made no difference to the behaviour.
I then tried down grading from Ant 1.8 to Ant 1.7. this time I did see a change in behaviour. the build does not run at all and I get the following error https://gist.github.com/4073149 at the terminal.
The javac
ant task looks like this.
<target name="compile-only" depends="">
<stopwatch name="Compilation"/>
<javac destdir="${build.classes.dir}" debug="on" deprecation="off"
classpathref="base.path" excludes="/filtering/**/**">
<src path="${src.dir}"/>
<src path="${build.autogen.dir}"/>
</javac>
<!-- Copy all resource files to the output dir -->
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
<include name="**/*.gif"/>
<include name="**/*.png"/>
<include name="**/*.jpg"/>
<include name="**/*.svg"/>
<include name="**/*.jpeg"/>
<exclude name="**/.svn"/>
</fileset>
</copy>
<stopwatch name="Compilation" action="total"/>
IDEA just prints Ant's output. Try switching the output from the tree view to the plain text view using the corresponding button on the left of the messages panel:
If the output contains errors, you should be able to see them there.
Also it's much faster and easier to use IDEA provided incremental compilation (
Build
|Make
).When using plain (not tree) output for ant IntelliJ uses
file (line,col): error msg
format for javac errors. But error view parser only understandsfile:line: error msg
format.You could tweak it in PlainTextView class from antIntegration.jar http://grepcode.com/file/repository.grepcode.com/java/ext/com.jetbrains/intellij-idea/10.0/com/intellij/lang/ant/config/execution/PlainTextView.java#98
I just changed addJavacMessage method to following and recompiled the class ``` java
```
And now I have clickable links in 'plain text' output mode of ant tool. Note, that 'tree mode' shows line & columns correctly - I used IDEA 13 CE.
It would be nice if somebody to create pull request for Intellij regarding this issue.