所有 Java Build 工具都有什么用? [英] What's with all the Java Build tools?

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

问题描述

使用 ant、maven 和 buildr 有什么意义?在 eclipse 或 netbeans 中使用构建不能正常工作吗?我只是好奇扩展构建工具的目的和好处是什么.

解决方案

  • 依赖项管理:构建工具遵循一个组件模型,该模型提供了在何处查找依赖项的提示.在 Eclipse/Netbeans 中,您必须依赖一个 JAR,而您并不真正知道这个 JAR 是否已更新.使用这些构建工具,他们知道"依赖项的更新(通常是因为与源控制存储库的良好集成)、重新计算传递依赖项并确保所有内容始终使用最新版本构建.

  • 访问控制:除了类级别的访问控制之外,Java 没有更高的抽象.使用这些构建工具,您可以准确指定您想要依赖的项目,并在更高的粒度级别控制可见性和访问权限.

  • 自定义控件:Eclipse/Netbeans 构建始终构建 JAR 文件.借助自定义构建机制,您可以根据需要使用额外的元数据信息构建自己的自定义(公司内部)存档.

  • 插件:构建工具附带了多种插件,它们可以在构建过程中执行各种操作.从生成 Javadoc 等基本操作到运行测试和获取代码覆盖率、静态分析、生成报告等更重要的操作.

  • 传输:一些构建系统还管理档案的传输 - 从开发系统到部署或生产系统.因此,您可以配置运输路线、时间表等.

查看一些持续集成服务器,例如 CruiseControlHudson.此外,Maven 的功能页面 提供了一些您想了解的信息.>

what's the point of using ant, maven, and buildr? won't the using build in eclipse or netbeans work fine? i'm just curious what the purpose and benefit of extended build tools are.

解决方案

  • Dependency Management: The build tools follow a component model that provides hints on where to look for dependencies. In Eclipse / Netbeans, you have to depend on a JAR and you don't really know if this JAR has been updated or not. With these build tools, they 'know' updates in dependencies (generally because of a good integration with your source control repository), recalculate transitive dependencies and ensure that everything is always built with the latest versions.

  • Access Control: Java, apart from class level access control, has no higher abstraction. With these build tools you can specify exactly which projects you want to depend on you and control visibility and access at a higher level of granularity.

  • Custom Control: The Eclipse / Netbeans build always builds JAR files. With custom build mechanisms, you could build your own custom (company-internal) archive with extra metadata information, if you so wish.

  • Plugins: There are a variety of plugins that come with build tools which can do various things during build. From something basic like generating Javadocs to something more non-trivial like running tests and getting code coverage, static analysis, generation of reports, etc.

  • Transport: Some build systems also manage transport of archives - from a development system to a deployment or production system. So, you can configure transport routes, schedules and such.

Take a look at some continuous integration servers like CruiseControl or Hudson. Also, the features page of Maven provides some insight into what you want to know.

这篇关于所有 Java Build 工具都有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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