Change maven default settings
If you have installed maven in your computer and start using it then it uses default repository which will be “${user.home}/.m2/repository”. To change default location please open setting.xml file (Location: Maven_home/settings.xml) and change default location wherever you want based on your preference as below:
Note: For maven install command will install libraries based on repository location setting in your settings.xml file.
For more information please refer maven tutorial here