构建与编译 (Java) [英] Building vs. Compiling (Java)

查看:19
本文介绍了构建与编译 (Java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

认为这个问题的答案很明显,但它是这样的:

Thinking that the answer to this is pretty obvious but here it goes:

当我为学校做一个小项目时(用 Java),我编译它.

When I am working on a small project for school (in java) I compile it.

在我的合作社中,我们使用 ant 构建我们的项目.

On my coop we are using ant to build our project.

我认为编译是构建的一个子集.这个对吗?构建和编译有什么区别?

I think that compiling is a subset of building. Is this correct? What is the difference between building and compiling?

相关:
编译和编译有什么区别?

推荐答案

构建"是一个过程,涵盖创建软件可交付成果"所需的所有步骤.在 Java 世界中,这通常包括:

The "Build" is a process that covers all the steps required to create a "deliverable" of your software. In the Java world, this typically includes:

  1. 生成来源(有时).
  2. 编译源代码.
  3. 编译测试源.
  4. 执行测试(单元测试、集成测试等).
  5. 包装(装入 jar、war、ejb-jar、ear).
  6. 运行运行状况检查(静态分析器,如 Checkstyle、Findbugs、PMD、测试覆盖率等).
  7. 生成报告.

如您所见,编译只是构建的(小)部分(最佳实践是使用 Maven 或 Ant 等工具完全自动化所有步骤并连续运行构建,这称为 持续集成).

So as you can see, compiling is only a (small) part of the build (and the best practice is to fully automate all the steps with tools like Maven or Ant and to run the build continuously which is known as Continuous Integration).

这篇关于构建与编译 (Java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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