每一个不曾起舞的日子都是对生命的辜负。
this just complies the files in the specified scope. So you can, for example, compile just a single class or a package (or, of course, a module). It does not transitively compile dependencies. So if Foo has a dependency on Bar, and Bar was not previously compiled, and you go to compile Foo only, the compilation fails. If Bar was previous compiled, but has changed, and you again only compile Foo, it uses the old compiled version and does not recompile the changed Bar class. Compile always compiles everything in the scope (i.e. a clean compile); this includes unmodified classes within the scope. But again, not transitively/recursively. If you compile module “GUI” which has a dependency on module “API”, only GUI is complied. If “API” was not previously compiled (or has changes) the compiling of GUI would fail. Finally, compile only compiles code. It does not create any artifacts (JARs, WARs, etc.)
Make is limited to the module or project level. (i.e. you cannot make a single class or package). It only compiles modified classes. Make, however, will transitively/recursively compile dependencies. Thus, using the above example, if we make “GUI”, it will also make “API” and compile any classes modified since last compilation. When you make a project, some additional tasks that tiled to the make process are performs, such as EJB validation. Finally, make only compiles classes and does not create any artifacts (JARs, WARs, etc.) So the main difference between compile and make is that compile can be performed on a finer level (class or package) and make compiles transitive/recursive dependencies.
This performs a full clean make on the project. So unlike make, it deletes all previous compiled objects. Rebuild can only be performed at the project level (so, “No” to answer your question about a module rebuild). Rebuild only compiles classes and does not create any artifacts (JARs, WARs, etc.)
There is also the “Build Artifact” action which allows you to “Build”, “Rebuild” or just clean the artifact. Build only builds it if there is modified code, whereas Rebuild always rebuilds it.
Also of note, in the compiler configuration, you can select to “Make the project automatically” if you have the “Use external build” option selected. The latter simply runs the build in a separate OS process. Therefore you can select the former, and IDEA will automatically make the project in the background. As such, when you go to run code or tests, there is typically little if any code that needs to be compiled.