Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use Vagrant with intelliJ?

Let's say I'm working with Java and using IntelliJ to do things like build and deploy and other things like that.

I haven't used Vagrant before, but is it possible to keep using IntelliJ for the building and deployment while running a Vagrant instance?

like image 827
Mr Mikkél Avatar asked May 03 '13 17:05

Mr Mikkél


2 Answers

Yes, you can use your IDE with Vagrant. I just spent a lot of time thinking about how to do this and answering a similar question, hopefully this gives you some context.

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

With the VM on a private network, you can deploy a WAR to a running web server as you would any remote server. Alternatively, from inside the VM you can symlink the webapps folder to the compile target on your host, eliminating the need to build a WAR and redeploy explicitly.

like image 164
Jason Avatar answered Oct 04 '22 09:10

Jason


You can also create a NFS shared directory in your vagrant and then you can access it both in your localhost and the vagrant box.

Just add this line to your Vagrantfile and then execute vagrant reload:

config.vm.synced_folder "shared", "/home/vagrant/shared", type: "nfs" ,  mount_options: ['rw', 'vers=3', 'tcp', 'fsc' ,'actimeo=2']

You can find the shared directory in the same folder as your Vagrantfile

like image 31
tokhi Avatar answered Oct 04 '22 09:10

tokhi