与 Java IDE 相比,我们还需要 Ant 吗? [英] Compare to the IDE for Java,do we still need Ant?

查看:39
本文介绍了与 Java IDE 相比,我们还需要 Ant 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前不久深入研究Ant,用它做简单的练习(编译、单元测试、打包).现在我平时的工作是在Eclipse下进行java开发,平时的工作都可以通过Eclipse的功能来简单的完成:实时编译、点击按钮部署、各种向导..

Not long before I had digged into Ant and use it doing simple practice(compile,unit test,package).Now my usual work is under Eclipse for java development,the usual work can all be simply done through Eclipse' function:in-time compiling、click button to deploy、various wizard..

所以我想知道在 Eclipse 下我们是否需要 Ant.如果是,我们应该在哪个方面使用 Ant 和 Eclipse.

So I am wondering under Eclipse do we have a need for Ant. And if it is, at which aspect should we use Ant along with Eclipse.

推荐答案

构建应用程序不仅仅是在您的 IDE 中构建它们.您需要设置一个自动化的构建和部署方法,该方法可以运行用于持续集成和部署.构建的包必须部署到各种环境并最终用于生产.您不能从自己的盒子中构建它们.您不能从 IDE 中构建它.您需要单独的构建系统.这就是 ANT 等构建工具的用武之地.

Building applications is not about just building them in your IDE. You need to setup an automated build and deploy method that can be run for, say, continuous integration and deployment. The built package has to be deloyed to various environments and finally production. You cannot build them out of your own box. You cannot build it out of your IDE. You need separate build system. That is where build tools like ANT come in.

另请注意,IDE 进行构建、部署的能力是有限的,这不是它们的强项.但是,可以使用 ANT 及其构建脚本和 在 Eclipse 中运行它们.这样,您的本地(开发人员)构建和主构建过程都有一组脚本.由于 ANT 基于 JAVA,您还可以通过编写自定义任务等来满足您的构建工具的需求.

Also note that the capabilities of IDEs for doing build, deploy is limited and that is not their strength. It is, however, possible to make use of ANT and its build scripts and run them out of eclipse. This way, you have a single set of scripts for both your local ( developer ) build and the main build process. With ANT being JAVA based, you can also suit your build tool to your needs by writing custom tasks etc.

此外,当您在构建系统中使用像 ANT 这样的标准时,您可以转移到不同的 IDE(如 Intellij IDEA)并仍然使用您熟悉的构建系统.

Also, when you make use of something as standard as ANT for your build system, you can move to a different IDE like Intellij IDEA and still make use of the build system that you know.

这篇关于与 Java IDE 相比,我们还需要 Ant 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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