为什么行家?有什么好处? [英] Why maven? What are the benefits?

查看:399
本文介绍了为什么行家?有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用maven相比,让我们说蚂蚁的主要好处是什么?
这似乎是更多的是烦恼的不是一个有用的工具。
我用maven 2,用普通的Eclipse的Java EE(无m2eclipse的),和tomcat。

行家的支持者认为,


  1. 的Maven让你得到你的包依赖性很容易


  2. Maven的力量,你有一个标准的目录结构


在我的经验


  1. 搞清楚软件包的依赖关系是真的没有那么难。你很少这样做也无妨。在升级过程中项目设置多一些时可能一次。使用Maven你最终会固定不匹配的依赖关系,写的不好劲歌,反正做包排除。


  2. 慢FIX编译 - 部署 - 调试周期,它可以杀死生产力。这是我的主要抱怨。你做出改变,你必须等待Maven构建踢,等待它来部署。无热部署任何责任。


还是我做错了?请点我正确的方向,我洗耳恭听。


解决方案

  

搞清楚软件包的依赖关系是真的没有那么难。你很少这样做也无妨。在升级过程中项目设置多一些时可能一次。使用Maven你最终会固定不匹配的依赖关系,写的不好劲歌,反正做包排除。


并不难......玩具项目。但是,我的工作项目有很多,真的很多人,和我很高兴,让他们传递地,要对他们有一个标准化的命名方案。手动管理这个全部由手工将是一场噩梦。

是的,有时你不得不对依赖的衔接工作。不过想想两次,这是不是固有的Maven,这是与生俱来的使用依赖任何系统(和我在这里谈论一般的Java依赖)。

因此​​,与蚂蚁,你必须做的相同除了你必须做手工一切工作:抓项目A及其依赖的一些版本,抓住项目B及其依赖的一些版本,搞清楚自己什么确切的,他们使用的版本,检查他们不重叠,检查它们并不矛盾,等等。欢迎来到地狱。

在另一方面,Maven的支持依赖管理,并会传递地获取他们对我,给我我需要管理复杂性的固有的依赖管理工装:我可以分析依赖关系树,控制在传递依赖所使用的版本,排除其中的一些如果要求,控制跨模块收敛,等有没有神奇。但至少你有支持。

和不要忘记,依赖管理只是什么Maven的报价的一小部分,还有更多(甚至不提的是,使用Maven很好地集成其他工具,如:声纳)。


  

慢FIX编译 - 部署 - 调试周期,它可以杀死生产力。这是我的主要抱怨。你做出改变,你必须等待Maven构建踢,等待它来部署。无热部署任何责任。


首先,你为什么要使用Maven这样吗?我不。我用我的IDE来编写测试,code,直到他们通过,重构,部署,热部署和运行本地Maven构建时,我做的,之前承诺,以确保我不会打破持续构建。

二,我不知道使用Ant将使事情要好得多。而我的经验,采用模块化的Maven构建使用二进制依赖提供了比典型的单片蚂蚁构建我更快的建造时间。不管怎么说,看看的Maven壳牌的准备(重新)使用Maven环境(这是由路真棒)。

因此​​,在结束了,我很抱歉这么说,这不是真的Maven的是杀害您的工作效率,这是你滥用你的工具。如果你不喜欢它,好,我能说什么,不使用它。就个人而言,我使用Maven自2003年以来,我从来没有回头。

What are the main benefits of using maven compared to let's say ant ? It seems to be more of a annoyance than a helpful tool. I use maven 2, with plain Eclipse Java EE (no m2eclipse), and tomcat.

Supporters of maven believe that

  1. Maven lets you get your package dependencies easily

  2. Maven forces you to have a standard directory structure

In my experience

  1. Figuring out package dependencies is really not that hard. You rarely do it anyway. Probably once during project setup and few more during upgrades. With maven you'll end up fixing mismatched dependencies, badly written poms, and doing package exclusions anyway.

  2. Slow FIX-COMPILE-DEPLOY-DEBUG cycle, which kills productivity. This is my main gripe. You make a change, the you have to wait for maven build to kick in and wait for it to deploy. No hot deployment whatsoever.

Or am I just doing it wrong ? Please point me to the right direction, I'm all ears.

解决方案

Figuring out package dependencies is really not that hard. You rarely do it anyway. Probably once during project setup and few more during upgrades. With maven you'll end up fixing mismatched dependencies, badly written poms, and doing package exclusions anyway.

Not that hard... for toy projects. But the projects I work on have many, really many, of them, and I'm very glad to get them transitively, to have a standardized naming scheme for them. Managing all this manually by hand would be a nightmare.

And yes, sometimes you have to work on the convergence of dependencies. But think about it twice, this is not inherent to Maven, this is inherent to any system using dependencies (and I am talking about Java dependencies in general here).

So with Ant, you have to do the same work except that you have to do everything manually: grabbing some version of project A and its dependencies, grabbing some version of project B and its dependencies, figuring out yourself what exact versions they use, checking that they don't overlap, checking that they are not incompatible, etc. Welcome to hell.

On the other hand, Maven supports dependency management and will retrieve them transitively for me and gives me the tooling I need to manage the complexity inherent to dependency management: I can analyze a dependency tree, control the versions used in transitive dependencies, exclude some of them if required, control the converge across modules, etc. There is no magic. But at least you have support.

And don't forget that dependency management is only a small part of what Maven offers, there is much more (not even mentioning the other tools that integrates nicely with Maven, e.g. Sonar).

Slow FIX-COMPILE-DEPLOY-DEBUG cycle, which kills productivity. This is my main gripe. You make a change, the you have to wait for maven build to kick in and wait for it to deploy. No hot deployment whatsoever.

First, why do you use Maven like this? I don't. I use my IDE to write tests, code until they pass, refactor, deploy, hot deploy and run a local Maven build when I'm done, before to commit, to make sure I will not break the continuous build.

Second, I'm not sure using Ant would make things much better. And to my experience, modular Maven builds using binary dependencies gives me faster build time than typical monolithic Ant builds. Anyway, have a look at Maven Shell for a ready to (re)use Maven environment (which is awesome by the way).

So at end, and I'm sorry to say so, it's not really Maven that is killing your productivity, it's you misusing your tools. And if you're not happy with it, well, what can I say, don't use it. Personally, I'm using Maven since 2003 and I never looked back.

这篇关于为什么行家?有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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