Ant build consoles get clobbered by dependent projects in Eclipse

折月煮酒 提交于 2019-12-11 07:47:39

问题


I have a set of dependent projects in Eclipse, each with its own Ant build script. If I make a change in multiple projects, then select "Build All" (Ctrl+B), each Ant build is invoked in the correct order. But if there is an error in one project, Eclipse still tries to build the other projects also, and in the process clobbers the Ant console so that the build errors are no longer visible. This wouldn't be quite so annoying if I could open up the offending project and select "Build Project", but Eclipse out-smarts me: it won't rebuild until I open some file in the project, edit it, and save (typically I add and remove a space character wherever my cursor happens to be). An answer to any of the following questions would be welcome.

How can I configure Eclipse to (in preference order):

  1. terminate a "Build All" as soon as any project's Ant build fails?
  2. save all console output for "Build All" instead of resetting the console for each project?
  3. spawn a separate console for each new instance of Ant?
  4. allow me to force a "Build Project" even if it doesn't think anything has changed?

[UPDATE] Bonus Question:

  • How can I configure Eclipse so that fixing any build errors in a depended-on project counts as a "change" for the purposes of "Build Project"?

回答1:


Have you tried redirecting standard out to file via a run configuration? A few screen shots to help if not... (you may try 'append' this is not in my screen shot :) )




回答2:


One alternative is to have each Ant build log itself, e.g., using the following in build.xml

<record name="build.log" 
        loglevel="verbose" 
        append="false" />

Oddly, Eclipse seems to disable this logging somehow when running an Ant build.




回答3:


I am not too big on ant, but can't you make the builds dependent on one another?



来源:https://stackoverflow.com/questions/703369/ant-build-consoles-get-clobbered-by-dependent-projects-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!