简体   繁体   中英

How to build multimodule project faster in maven 2?

I have a multimodule maven project in which there are 7 several modules. Every time I modify a code in one of the module and run mvn clean install, it takes some time and I think there might be a way to reduce time of builds since I only change small part of the code and I think it effects only limited area. So I guess instead of running "mvn clean install" there is a better command option.

I am using maven 2.x.

Any better ideas?

TIA

The "clean" goal deletes all the target folders which contain the compiled classes, it should not be necessary to run that goal as part of the modify-compile-test cycle that you may run many times per day. In your case most of the time is probably spent re-compiling all the Java files, due to the class files having been deleted during the "clean" goal. So I would use "mvn install" when testing local changes, and "mvn clean install" only periodically, like when you get other developers changes to integrate with, or when testing immediately before a release.

I would suggest to use the following :

mvn -pl TheModuleYouHaveChanged -amd install

or maybe a

mvn -pl TheModuleYouHaveChanged -amd package

is enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM