002Maven构建工作场景系列

一、只构建仓库中的一个项目

假如仓库下有非常多的子项目,如上图所示xxx-test-page-td,xxx-test-page-zh,xxx-test-page等等,只想打包编译其中的xxx-test-page-zh这一个项目,mvn命令如下:

mvn clean package -pl xxx-test-page-zh -am -Dmaven.test.skip=true
  • clean:清除之前构建生成的文件。
  • package:打包项目并生成jar/war文件。
  • -pl xxx-test-page-zh:指定只构建uwork-portal-page-zh模块,跳过其他模块。 -pl,--projects <arg> you list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path
  • -am:构建xxx-test-page-zh模块的同时,也构建该模块的依赖模块。-am,--also-make If project list is specified, also build projects required by the list
  • -Dmaven.test.skip=true:跳过测试阶段,不执行测试用例。-D,--define <arg> Define a system property

 

posted @ 2023-07-05 17:16  arun_python  阅读(19)  评论(0)    收藏  举报