Maven Available lifecycle phases

博客围绕Maven展开,介绍了项目打包方式,若未指定打包值默认是jar。重点阐述了Maven构建生命周期的30个阶段,包括validate验证项目、compile编译源码、package打包代码等,还说明了各阶段的主要任务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Packaging

The first, and most common way, is to set the packaging for your project via the equally named POM element . Some of the valid packaging values are jar, war, ear and pom. If no packaging value has been specified, it will default to jar.
Each packaging contains a list of goals to bind to a particular phase. For example, the jar packaging will bind the following goals to build phases of the default lifecycle.
在这里插入图片描述在这里插入图片描述

No goals have been specified for this build,Well, this just tells you that Maven has no idea what it should do. In general, you have the following options to perform build steps。官方Introduction to the Build Lifecycle,Maven Available lifecycle phases共30個階段,下面將對每個階段詳細講解。

1. validate

validate the project is correct and all necessary information is available

2. initialize

initialize build state, e.g. set properties or create directories

3. generate-sources

generate any source code for inclusion in compilation

4. process-sources

5. generate-resources

6. process-resources

7. compile

compile the source code of the project

8. process-classes

9. generate-test-sources

10. process-test-sources

11. generate-test-resources

12. process-test-resources

13. test-compile

14. process-test-classes

15. test

test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed

16. prepare-package

17. package

take the compiled code and package it in its distributable format, such as a JAR.

18. pre-integration-test

19. integration-test

20. post-integration-test

21. verify

run any checks on results of integration tests to ensure quality criteria are met

22. install

install the package into the local repository, for use as a dependency in other projects locally

23 deploy

done in the build environment, copies the final package to the remote repository for sharing with other developers and projects.

24. pre-clean

25. clean

the clean lifecycle handles project cleaning

26. post-clean

27. pre-site

28. site

the site lifecycle handles the creation of your project’s site documentation

29. post-site

30. site-deploy

deploy the generated site documentation to the specified web server

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值