How to install your project into Maven local repository

In Maven, you can use “mvn install” to package your project and deploy to local repository automatically, so that other developers can use it.

mvn install
When “install” phase is executed, all above phases “validate“, “compile“, “test“, “package“, “integration-test“, “verify” phase , including the current “install” phase will be executed orderly. Refer to this Maven lifecycle for detail.

mvn install example

A Java project, with following pom.xml file

File : pom.xml

<project xmlns="" 

Based on above pom.xml file, when “mvn install” is executed, it will package the project into “mkyong-core-99.jar” file and copy to your local repository. See following diagram :

Install project to Maven local repository
It’s always recommended to run “clean” and “install” together, so that you are always deploy the latest project to your local repository.

mvn clean install

Access Deployed Project

Now, other developers are able to access your deployed “jar” file by declaring below dependency tag in their pom.xml file.

Tags :

About the Author

Founder of and, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.