Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
980 views
in Technique[技术] by (71.8m points)

intellij idea - Ant build on InteliiJ Community Edition no compiler errors shown

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"/>

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:

Plain Text View

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...