为什么 Maven 的代表如此糟糕? [英] Why does Maven have such a bad rep?

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

问题描述

互联网上有很多关于 Maven 是多么糟糕的讨论.我已经使用 Maven 的一些功能几年了,我认为最重要的好处是依赖管理.

There is a lot of talk on the internet about how Maven is bad. I have been using some features of Maven for a few years now and the most important benefit in my view is the dependency management.

Maven 文档不够充分,但通常当我需要完成某件事时,我会想出一次然后它就可以工作了(例如,当我实现了对 jar 的签名时).我不认为 Maven 很棒,但它确实解决了一些问题,如果没有它,这将是一个真正的痛苦.

Maven documentation is less than adequate, but generally when I need to accomplish something I figure it out once and then it works (for example when I implemented signing the jars). I don't think that Maven is great, but it does solve some problems that without it would be a genuine pain.

那么,为什么 Maven 的代表如此糟糕,我可以期待未来 Maven 会出现什么问题?也许有我不知道的更好的选择?(例如,我从未仔细研究过 Ivy.)

So, why does Maven have such a bad rep and what problems with Maven can I expect in the future? Maybe there are much better alternatives that I don't know about? (For example, I never looked at Ivy in detail.)

注意:这不是试图引起争论.试图清除 FUD.

NOTE: This is not an attempt to cause an argument. It is an attempt to clear the FUD.

推荐答案

我当然 bitched &过去抱怨maven.但现在,我不会没有它.我觉得好处远远大于任何问题.主要是:

I've certainly bitched & moaned about maven in the past. But now, I wouldn't be without it. I feel that the benefits far outweigh any problems. Chiefly:

  • 标准化的项目结构.
    • 假设一个新开发者加入了一个项目:
      • 当你说它是一个Maven项目时,开发者就知道项目的布局以及如何构建和打包项目
      • 当你说它是一个 Ant 项目时,开发人员将不得不等待你解释更多或者必须通过 build.xml 来弄清楚.
      • 不仅使用外部库,还使用内部库/模块.请务必使用 Maven 存储库代理服务器,例如 NexusArtifactory.
      • 可以使用 Ivy 来完成其中的一些工作.事实上,如果您只需要依赖项管理,那么使用 Ivy 可能会更好.
      • Not just with external libraries but also with internal libraries/modules. Be sure to use a Maven repository proxy server such as Nexus or Artifactory.
      • It's possible to do some of this with Ivy. In fact, if all you need is a dependency management, you're probably better off using Ivy.

      我的缺点主要是:

      • 命令行非常无用.这让我一开始就很失望.
      • XML 格式非常冗长.我可以理解为什么要这样做,但阅读起来仍然很痛苦.
        • 也就是说,它有一个 XSD,便于在 IDE 中进行编辑.
        • The definitive guide to maven is a good introduction however.

        我真的相信花一点时间了解 maven 是值得的.

        I truly believe that it's worth spending a little bit of time getting to know maven.

        这篇关于为什么 Maven 的代表如此糟糕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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