Vagrant for a Java project: should you compile in the VM or on the host?

前端 未结 2 1443
没有蜡笔的小新
没有蜡笔的小新 2021-01-29 18:10

Here’s the question: When using Vagrant for a Java project (or any compiled language project for that matter), should you compile in the VM or on the host? Also, would you want

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-29 18:52

    I was interested to this topic during the last year :)

    My solution is to have a vagrant machine configurable with flags. For example one of this flag enable the desktop gui because some developer prefer to code on the host machine while others prefer to have a much more integrated environment with the desktop and the IDE in it.

    To face the desktop slowness you should install a very useful vagrant plugin (yeah... vagrant has plugins that greatly improve the development environment) in this way: vagrant plugin install vagrant-vbguest This plugin will install virtual box guest addition on every guest to make it usable while using the virtualbox interface. Then to enable the gui edit the Vagrantfile in this way:

    config.vm.provider "virtualbox" do |vb| vb.gui = true end

    Instead to speed-up the shared folder performances I suggest to use rsync: config.vm.synced_folder "./git", "/home/vagrant/git", type: "rsync", rsync__exclude: ".git/" In this way the source code is edited on the host and then rsync-ed to the guest.

提交回复
热议问题