maven 單獨構建多模組專案中的單個模組
阿新 • • 發佈:2020-07-31
最近在公司的一個專案裡用到了maven的多模組,由於專案比較大,每次修改後構建整個工程耗時太久,需要單獨構建某個模組,mvn有支援的選項:
- -pl, --projects
- Build specified reactor projects instead of all projects
- -am, --also-make
- If project list is specified, also build projects required by the list
- -amd, --also-make-dependents
-
If project list is specified, also build projects that depend on projects on the list
首先切換到工程的根目錄,
單獨構建模組 pingjuan-web,同時會構建 pingjuan-web 模組依賴的其他模組
$ mvn
install
-pl pingjuan-web -am
單獨構建模組 pingjuan-common,同時構建依賴模組 pingjuan-common 的其他模組
$ mvn
install
-pl pingjuan-common -am -amd
轉載:https://blog.csdn.net/yanjunlu/article/details/39177115?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-9.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-9.channel_param