maven build lifecycle

一,流程列表

在default lifecycle里,包含下列最常用被执行的phases(文章最后会给出lifecycle phases的完整列表):

  •     validate : validate the project is correct and all necessary information is available
  •     compile : compile all java files in project
  •     test : 使用unit test framework来test the compiled source code。这些test class不会被packaged and deployed。
  •     package : 把compiled code打包成你需要的格式,如JAR.
  •     integration-test : 把已经打包的东东(如jar)deploy到运行环境内,用于集成测试
  •     verify : run any checks to verify the package is valid and meets quality criteria
  •     install : install the package into the local repository, 这样做的目的是作为其他projects的一个local dependency
  •     deploy : 该phase会copy final package到remote repository for sharing。This phase is done in an integration or release environment。


另外还有3个很常用的、但不属于default lifecycle的phase:
  •     clean : cleans up artifacts created by prior builds
  •     site : generates site documentation for this project
  •     eclipse:eclipse : 创建相关的eclipse ide文件  
lifecycle phases的完整列表(按执行的先后顺序)
validate
validate the project is correct and all necessary information is available.
generate-sources
generate any source code for inclusion in compilation.
process-sources
process the source code, for example to filter any values.
generate-resources
generate resources for inclusion in the package.
process-resources
copy and process the resources into the destination directory, ready for packaging.
compile
compile the source code of the project.
process-classes
post-process the generated files from compilation, for example to do bytecode enhancement on Java classes.
generate-test-sources
generate any test source code for inclusion in compilation.
process-test-sources
process the test source code, for example to filter any values.
generate-test-resources
create resources for testing.
process-test-resources
copy and process the resources into the test destination directory.
test-compile
compile the test source code into the test destination directory
test
run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
prepare-package
perform any operations necessary to prepare a package before the actual packaging. This often results in an unpacked, processed version of the package. (Maven 2.1 and above)
package
take the compiled code and package it in its distributable format, such as a JAR.
pre-integration-test
perform actions required before integration tests are executed. This may involve things such as setting up the required environment.
integration-test
process and deploy the package if necessary into an environment where integration tests can be run.
post-integration-test
perform actions required after integration tests have been executed. This may including cleaning up the environment.
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.
 

参考:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值