Building vs. Compiling (Java) Ask Question

Building vs. Compiling (Java) Ask Question

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

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

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?

Related:
What is the difference between compiling and building?

ベストアンサー1

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. 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.

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).

おすすめ記事