I have multimodule maven project. Found that:
mvn clean - takes 3 minutes after
mvn install - takes 18 minutes.
So I suppose that mvn clean install should take 21 minutes, but it takes near 30 minutes! So does it the same:
mvn clean install
and
mvn clean
mvn install
? Thanks.
mvn clean install tells maven to do the clean phase in each module before running the install phase for each module. mvn clean is its own build lifecycle phase (which can be thought of as an action or task) in maven. In Maven terms: clean is a phase of the clean lifecycle.
mvn package: Creates JAR or WAR file for the project to convert it into a distributable format. mvn install: Deploys the packaged JAR/ WAR file to the local repository.
mvn clean install calls clean first, then install . You have to clean manually, because clean is not a standard target goal and not executed automatically on every install. clean removes the target folder - it deletes all class files, the java docs, the jars, reports and so on.
AFAIK, yes, although I'm a little surprised startup/resolution/etc. takes that much time.
Things like OS-caching, JVM startup/optimization/etc., and so on would all play a role in the differences.
let take this example
framework
framework-utils
foundation
foundation-model
foundation-api
foundation-core
The call order of my modules:
1. mvn clean / mvn install: [clean] framework-utils [clean]
foundation-model [clean] foundation-api [clean] foundation-core
[install] framework-utils [install] foundation-model [install]
foundation-api [install] foundation-core
2. mvn clean install: [clean] framework-utils [install]
framework-utils [clean] foundation-model [install] foundation-model
[clean] foundation-api [install] foundation-api [clean]
foundation-core [install] foundation-core
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With