问题描述
我在读的博客通过的肯特R.Spillner 有关Java构建工具。虽然我不常使用Ant和Maven,我没得COMMITED要么一人伤势严重,我打算这样做。是博客文章,我链接的夸大呢?最重要的是,我应该使用Maven或Ant进行一个中等规模的项目(约20K LOC)。
I was reading this blog by Kent R.Spillner regarding java build tools. Although I have lightly used Ant and Maven, I didn't have commited to either one seriously which I intend to do. Is the blog post I linked an exagerated one? Most importantly, should I use Maven or Ant for a medium sized project ( approximately 20K LOC).
推荐答案
这要看。
Maven和蚂蚁都只是不同的方法:命令性和声明(见)
的Maven 是管理依赖更好的(但蚂蚁是确定与他们一样,如果你使用Ant +常春藤),并建立文物。主要受益于Maven的 - 它的生命周期。您只需加上正确的相位,这似乎是pretty逻辑的具体行动:只需启动你集成测试阶段,例如集成测试。此外,还有许多现有的插件,它可以几乎可以一切。 Maven原型是强大的功能,它可以让你快速创建项目。
Maven is better for managing dependencies (but Ant is ok with them too, if you use Ant+Ivy) and build artefacts. The main benefit from maven - its lifecycle. You can just add specific actions on correct phase, which seems pretty logical: just launch you integration tests on integration-test phase for example. Also, there are many existing plugins, which can could almost everything. Maven archetype is powerful feature, which allows you to quickly create project.
Ant的是构建过程的控制更好。你的第一个版本之前,你必须写你build.xml中。如果您的构建过程是非常具体的,你必须创建复杂的脚本。对于长期项目的支持ANT-脚本可能会成为真的很痛苦:脚本变得太复杂,人,谁是他们写的,可以离开项目等。
Ant is better for controlling of build process. Before your very first build you have to write you build.xml. If your build process is very specific, you have to create complicated scripts. For long-term projects support of ant-scripts could become really painful: scripts become too complicated, people, who's written them, could leave project, etc.
两者都使用XML,这有可能成为大的长期项目太大。
Both of them use xml, which could become too big in big long-term projects.
反正你阅读768,16具体文件(不恨篇)两个。此外,还有蚂蚁Maven的插件,它允许使用Maven推出蚂蚁脚本。
Anyway, you shoud read specific documentation (not hate-articles) on both. Also, there is ant-maven-plugin, which allow to launch ant-scripts with maven.
P.S。您可以在摇篮,这对我来说可以提供更多的自由比Maven的,但是是很容易,Ant来使用看看。
P.S. You can take a look on Gradle, which for me could provide more freedom than Maven, but is easier to use than Ant.
这篇关于Java构建工具:蚂蚁与Maven的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!