MAVEN – Reduce build time in local enviornment

In most of the Java projects, Maven is being used as a build tool. We use “mvn –U install” command to build the project. While building the project, the maven will download the dependent jars (mentioned in POM.xml file) from the project specific repository/maven repository. Once the build is completed, then all the downloaded jars will be stored in local machine(C:/Users/<>/.m2).

Please run .m2 command on the Run window and check it out.

This kind of build process will take more time as it needs to download all the jars. But this is not required all the times. We can use the downloaded local jars available in the local repository for building the project in the next time

To do that we need to pass –o option while building our project. For example, mvn –o install. This will speed up our code build time.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s