Maven單獨構建多模塊項目中的單個模塊


說明:

1、可能存在的場景,多模塊項目沒有互相引用,那么此時可以單獨構建單個項目,指定到子模塊的pom.xml文件即可完成編譯。

2、如果多模塊項目各自都引用了,那么單獨編譯子模塊的pom.xml文件會直接報錯,解決方法就是編譯父項目pom.xml。

3、如果編譯父項目,那么可能會造成編譯時間很慢,其中有些項目也不需要編譯,解決方法如下:

解決方法:

Maven選項:

-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

首先切換到工程的根目錄

單獨構建模塊jsoft-web,同時會構建jsoft-web模塊依賴的其他模塊

mvn install -pl jsoft-web -am

單獨構建模塊jsoft-common,同時構建依賴模塊jsoft-common的其他模塊 

mvn install -pl jsoft-common -am -amd

 

參考:

http://blog.csdn.net/yanjunlu/article/details/39177115(以上內容轉自此篇文章)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM