six*_*ude 127 java compilation build
认为对此的答案非常明显,但在这里:
当我在学校的一个小项目(在java中)时,我编译它.
在我的鸡舍上,我们使用ant来构建我们的项目.
我认为编译是构建的一个子集.它是否正确?构建和编译有什么区别?
相关:
编译和构建有什么区别?
Pas*_*ent 217
"构建"是一个涵盖创建软件"可交付"所需的所有步骤的过程.在Java世界中,这通常包括:
正如您所看到的,编译只是构建的一个(小)部分(最佳实践是使用Maven或Ant等工具完全自动化所有步骤,并连续运行构建,称为持续集成).
Dar*_*ien 41
我在这里看到的一些答案是脱离上下文的,如果这是一个C/C++问题则更有意义.
精简版:
"建筑"是一个通用术语,描述了包括编译在内的整个过程.例如,构建过程可能包括生成Java代码或文档文件的工具.
通常会有其他阶段,例如"package",它将所有.class文件放入.jar,或"clean"清除.class文件和临时目录.
Kai*_*ili 29
编译是将源代码转换为目标代码的行为.
链接是将目标代码与库组合成原始可执行文件的行为.
构建是由编译和链接组成的序列,可能还有其他任务,例如安装程序创建.
许多编译器在编译源代码后自动处理链接步骤.
在 Java 中:构建是一个生命周期,包含一系列命名阶段。
例如:maven 它有三个构建生命周期,下面一个是default构建生命周期。
?validate - validate the project is correct and all necessary information is available
?compile - compile the source code of the project
?test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
?package - take the compiled code and package it in its distributable format, such as a JAR.
?integration-test - process and deploy the package if necessary into an environment where integration tests can be run
?verify - run any checks to verify the package is valid and meets quality criteria
?install - install the package into the local repository, for use as a dependency in other projects locally
?deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
Run Code Online (Sandbox Code Playgroud)