Java 世界中有多少人使用 Maven?

发布于 2024-10-09 22:39:33 字数 126 浏览 0 评论 0原文

我正在为 Java 库构建教程。有一种非常简单的方法可以开始使用 Maven + Eclipse,但我不确定是否可以假设大多数学习本教程的人都会安装 Maven。所以,我很好奇,Java 世界中有多少人使用 Maven 来管理他们的项目?

I'm building a tutorial for a Java library. There's a really easy way to get started with Maven + Eclipse, but I'm not sure I can assume the majority of the people following this tutorial will have Maven setup. So, I'm curious, what percentage of the Java world uses Maven to manage their projects?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

青朷 2024-10-16 22:39:33

如果您的库不是以 Maven 为中心,我会更喜欢与构建工具无关的教程和可选的附录,它可以解释您的库在特定环境(Eclipse、Netbeans、Ant、Maven 等)中的用法。

If your library is not Maven centric i will prefer a build-tool agnostic tutorial and optional an appendix that may explain usage of your library in the specific environments (Eclipse, Netbeans, Ant, Maven, ...).

梦断已成空 2024-10-16 22:39:33

检查这个关于SO的其他问题,其中包含大量详细信息。就我个人而言,我喜欢 Maven,它可以帮助我几乎立即开始任何项目,而无需大惊小怪。此外,maven 还具有可与所有 IDE 配合使用的插件,让生活变得非常轻松。

Check this other Question on SO with ton of details. Personally I like maven which helps me getting started with any project almost immediately with minimum fuss. Also maven had plugins to work with all IDE's and makes life really easy.

情深已缘浅 2024-10-16 22:39:33

是的,文档不是最好的。然而,当尝试管理中型到大型项目时,maven 是一个救星。由于生活中的这一事实,添加不在 Maven 上的开源库是一件痛苦的事情。

maven 的优点不仅仅是自动下载依赖项,而且它还强加了一个标准目录结构,这意味着我可以针对我们使用的任何库(内部库或开源库)编写脚本。

Maven 最大的缺点:

  • 非常冗长的命令行。
  • 文档晦涩难懂且分散,
  • 没有通用的帮助工具

也就是说,我对许多问题的解决方案是一个自定义的 ant build.xml 文件,其中我的标准 mvn 目标定义为更简单的 ant 目标(这也允许我添加自己的帮助文本。 )

更新:

我真的应该说该文档很神秘。我与典型 Maven 开发人员关于文档的大部分经验都以这种交流为代表:

我:“我不明白如何做到这一点,并且代码的行为非常糟糕。”

他们:”解决此问题的建议方法是下载有问题的 DTD 并使用目录解析器。请参阅

我:令人愉快。 RTFM。如果为这个非常常见的用例提供了一个很好的示例,那么这个插件对于那些没有时间解密手册的用户来说会更有用。

他们:我很抱歉,但我无法理解你。 “目录属性”的文档(参见上面的链接)清楚地展示了如何配置目录文件的使用。

我:作为我在 google 工作的一个聪明人朋友,他这样说:
“是的,如果您知道如何做,文档会准确说明如何做。”

Yes the documentation isn't the best. However, maven is a life saver when trying to manage a medium to large scale project. Because of this fact of my life, adding an open-source library that is not on maven is a pain.

The advantage of maven is not just the auto-download of dependencies, but it also imposes a standard directory structure which means that I can script against any library we use, internal or open-source.

The biggest Maven cons:

  • the very verbose command line.
  • documentation is cryptic and scattered
  • no universal help facility

That said, my solution to many of these issues is a custom ant build.xml file with my standard mvn goals defined as simpler ant targets ( which also allows me to add in my own help text.)

Update:

I really should say that the documentation is cryptic. Most of my experience with the typical maven developer about documentation is typified by this exchange:

Me: "I don't understand how to do this and the code behaves very badly."

Them: "The suggested way to resolve this is to download the DTD in question and use a catalog resolver. See the "catalogs" property in http://mojo.codehaus.org/xml-maven-plugin/validation.html"
( Their suggestion involves several pages with not a single complete example)

Me: Delightful. RTFM. It would make this plugin more useful for users who do not have the time to decrypt the manual if a good example was provided for this very common usecase.

Them: I am sorry, but I can't follow you. The documentation of the "catalog property" (see link above) clearly shows how to configure the use of a catalog file.

Me: As a friend of mine, smart guy, works at google, said this:
"Yes, the documentation says exactly how to do if you know how to do it."

汐鸠 2024-10-16 22:39:33

我看到很多不同的(企业)Java 系统,其中多达一半的系统使用 Maven。
所以,我想说你绝对可以在示例中使用 Maven,因为它是一种相当常见的方法。只需确保提供一个下载 jar 文件的链接即可。使用 Ant 或其他构建工具的人会知道如何使用它。

I see a lot of different (corporate) Java systems, and up to half of the systems use Maven.
So, I'd say you can definitely use Maven in the example, as it is a rather common approach. Just make sure to provide a link to download the jar file as well. People using Ant or other build tools will know how what to do with it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文