https://www.vagrantup.com/docs/synced-folders/basic_usage.html
config.vm.synced_folder "/Users/<username>/.m2", "/home/vagrant/.m2"
Synced folders are configured within your Vagrantfile using the
config.vm.synced_folder
method. Usage of the configuration directive is very simple:Vagrant.configure("2") do |config|
# other config here
config.vm.synced_folder "src/", "/srv/website"
end
The first parameter is a path to a directory on the host machine. If the path is relative, it is relative to the project root. The second parameter must be an absolute path of where to share the folder within the guest machine. This folder will be created (recursively, if it must) if it does not exist.
config.vm.synced_folder "/Users/<username>/.m2", "/home/vagrant/.m2"