JavaGian java tutorial and java interview question and answer

JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.

Maven local repository location & how to change it?

In this tutorial, learn to change maven local repository location. Maven is build and dependency management tool. It downloads required project dependencies to our local system and include them to project compilation or run-time as defined.

1. Maven’s default local repository location

By default maven’s local repository exist on ‘${user.home}/.m2/repository’. In different operating systems, these path are resolved to –
Windows 7:   C:/Documents and Settings/<username>/.m2/repository
Windows 10:  C:/Users/<username>/.m2/repository
Linux:    /home/<username>/.m2/repository
Mac:    /Users/<username>/.m2/repository
We can change local repository location to some other location of our choice.

2. Change maven local repository location

Maven is distributed as archive folder. Generally, developers download the maven and extract it their workstation.
After you have downloaded the maven, follow given simple steps to change maven local repository location to some other path.

.