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

查看:393
本文介绍了构建与编译(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.

在我的coop,我们使用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?


相关:

编译和构建之间有什么区别?


推荐答案

Build是一个包含创建软件可交付所需的所有步骤的过程。在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. 运行运行状况检查(如Checkstyle,Findbugs,PMD,测试覆盖率等静态分析器)。
  5. $ b(包括jar,war,ejb-jar,ear) $ b
  6. 生成报告。

  1. Generating sources (sometimes).
  2. Compiling sources.
  3. Compiling test sources.
  4. Executing tests (unit tests, integration tests, etc).
  5. Packaging (into jar, war, ejb-jar, ear).
  6. Running health checks (static analyzers like Checkstyle, Findbugs, PMD, test coverage, etc).
  7. Generating reports.

如你所见,编译只是构建的一个最好的做法是使用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天全站免登陆