希望这个Java项目,自动运行的Ant构建文件 [英] Want an eclipse java project to run ant build files automatically

查看:295
本文介绍了希望这个Java项目,自动运行的Ant构建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Eclipse Java项目,而不是一个插件项目。而该项目是我在两个不同的蚂蚁文件处理一些外部依赖性。一切工作正常,但我想强制Eclipse中每次它建立我的项目运行ant文件。

I have an Eclipse Java project, not a plugin project. And the project has some external dependencies that I handle in two separate ant files. Everything works fine, but I want to force Eclipse to run the ant files everytime it builds my project.

我怎么能这样做?

如果这一直是一个插件项目,我会在我的build.properties在 customBuildCallbacks.xml 的处理,并列入它,但似乎不其时刚参加工作Java项目

If this had been a plugin project I would have handled it in a customBuildCallbacks.xml and included it in my build.properties, but doesnt seem to work when its just a java project

推荐答案

第1步:生成文件添加到Ant视图

Step 1: Add the build file to your ant view

点击Add按钮并选择从项目的build.xml文件。您也可以将build.xml文件拖动到Ant视图(要Ant视图添加到您的角度探讨,去窗口>显示视图>其他...)

Click the add button and select the build.xml file from the project. You can also drag the build.xml file onto the ant view (To add the ant view to your perpective, go to Window > Show View > Other…)

第二步:在为Ant生成

Step 2: Run as Ant Build

在你的Ant视图中,右击新添加的构建文件,并选择Run As> Ant构建...在对话窗口中,选择隐藏不选择执行内部目标中的目标选项卡选项。如果你希望(我通常会删除尾随'的build.xml你可以在窗口顶部的重命名框中的建设者。单击应用和关闭。

In your ant view, right click the newly added build file and select Run As > Ant Build… In the dialog window, select the ‘Hide internal targets not selected for execution’ option in the Targets tab. You can rename the builder in the box at the top of the window if you wish (I usually remove the trailing ‘build.xml’. Click Apply and Close.

第三步:设置自动构建

右键单击该项目,选择属性,然后建设者。单击导入。关闭屏幕前,彰显进口版本,然后选择编辑。转至目标选项卡中选择干净的'干净后和deploy.local为自动生成。应用更改并关闭。

Right click on the project, select Properties, then Builders. Click Import. Before closing the screen, highlight the imported build and select edit. Go to the Targets tab select clean for ‘After a clean’ and deploy.local for ‘Auto build’. Apply the changes and close.

第4步:启用自动生成

转到项目>自动构建

来源:<一个href=\"http://www.simonwhatley.co.uk/using-ant-with-eclipse\">http://www.simonwhatley.co.uk/using-ant-with-eclipse

这篇关于希望这个Java项目,自动运行的Ant构建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆