Maven的生命周期
来源:互联网 发布:手机追踪软件 编辑:程序博客网 时间:2024/05/22 17:04
maven包括了三套相互独立的生命周期
clean 清理项目
default 构建项目
site 建立项目站点
1.clean主要负责项目清理
2.default构建项目(最核心)default生命周期定义了真正构建时所需要执行的所有步骤
default生命周期定义了真正构建时所需要执行的所有步骤
validatevalidate the project is correct and all necessary information is available.initializeinitialize build state, e.g. set properties or create directories.generate-sourcesgenerate any source code for inclusion in compilation.process-sourcesprocess the source code, for example to filter any values.generate-resourcesgenerate resources for inclusion in the package.process-resourcescopy and process the resources into the destination directory, ready for packaging.compilecompile the source code of the project.process-classespost-process the generated files from compilation, for example to do bytecode enhancement on Java classes.generate-test-sourcesgenerate any test source code for inclusion in compilation.process-test-sourcesprocess the test source code, for example to filter any values.generate-test-resourcescreate resources for testing.process-test-resourcescopy and process the resources into the test destination directory.test-compilecompile the test source code into the test destination directoryprocess-test-classespost-process the generated files from test compilation, for example to do bytecode enhancement on Java classes. For Maven 2.0.5 and above.testrun tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed.prepare-packageperform 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)packagetake the compiled code and package it in its distributable format, such as a JAR.pre-integration-testperform actions required before integration tests are executed. This may involve things such as setting up the required environment.integration-testprocess and deploy the package if necessary into an environment where integration tests can be run.post-integration-testperform actions required after integration tests have been executed. This may including cleaning up the environment.verifyrun any checks to verify the package is valid and meets quality criteria.installinstall the package into the local repository, for use as a dependency in other projects locally.deploydone in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
3.site主要负责项目清理
目的是建立和发布项目站点,maven能够基于POM所包含的信息,自动生成一个友好的站点,方便团队交流和发布项目信息
从命令行执行maven任务的最主要方式就是调用maven的生命周期阶段。需要注意的是,各个生命周期是相互独立的,而一个生命周期的阶段是有前后依赖关系的。生命周期阶段有前后依赖关系,三套生命周期本身是相互独立的,用户可以仅调用clean生命周期的某个阶段,也可以不执行clean周期,而直接执行default生命周期的
下面举几个例子:
mvn clean :该命令调用clean生命周期的clean阶段。实际执行的阶段为clean生命周期的pre-clean和clean阶段。
mvn test:该命令调用default生命周期的test阶段。实际调用的是default生命周期的validate、initialize等,直到test的所有阶段。
mvn clean install:该命令调换用clean生命周期的clean阶段和default生命周期的instal阶段。
0 0
- maven(9)--maven的生命周期
- Maven构建的生命周期
- Maven的生命周期
- Maven的生命周期
- maven的生命周期
- Maven的生命周期
- Maven的生命周期
- maven的生命周期
- Maven的生命周期
- maven 的三个生命周期
- Maven的生命周期
- Maven的生命周期
- Maven的生命周期阶段
- Maven的生命周期
- maven的生命周期
- Maven的生命周期阶段
- Maven的生命周期
- Maven 的生命周期介绍
- 【Codeforces38G】Queue【Splay】【二分】
- Android自定义Dialog
- memcached 常用方法介绍
- BZOJ 2653: middle|主席树
- hdoj 2032 杨辉三角
- Maven的生命周期
- HDU 5631 (BestCoder Round #73 (div.1) 1001)Rikka with Graph(并查集)
- react-native启动异常,react-deep-force-update/.babelrc
- iOS 9中需要使用 QQ/QQ空间/支付宝/微信SDK 的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码
- 浪漫爱心--第三方开源--PeriscopeLayout
- apt-get的update和upgrade的区别
- 老男孩Linux运维04-配置secureCRT远程连接Linux及功能配置
- LEEDCODE 14 Longest Common Prefix (JAVA题解)
- 英语学习: The Greatest Law of Life