vagrant对java / javaee开发人员有用吗? [英] Is vagrant useful for java/javaee developers?

查看:242
本文介绍了vagrant对java / javaee开发人员有用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用java / javaee时,通常的开发环境设置是在本地拥有一切(jdk安装,数据库,appserver等)。我知道ruby / js世界中有很多人使用虚拟机进行开发(主要是使用vagrant)。

When working with java/javaee usual development environment setup is to have everything locally (jdk installation, database, appserver etc). I know a lot of people in ruby/js world use virtual machines for development (mainly with vagrant).

我想知道是否有一种有效的方法来为java / javaee设置类似的env。
我怀疑我可以在这样的虚拟机上轻松地将数据库服务器和应用服务器与jdk版本一起安装,但是常规开发呢?我还需要在本地安装jdk,对吧? (我需要我的IDE才能正常工作)我需要maven来构建我的项目,所以我需要完整的maven本地回购。然后我需要在虚拟机的应用服务器上部署我的应用程序。

I wonder if there is an efficient way to set up similar env for java/javaee. I suspect that I can easily install database server and application server together with jdk version on such virtual machine, but what about regular development? I still need to have jdk installed locally, right? (I need my IDE to work properly) I need maven to build my project, so that I need full maven local repo. And then I need to deploy my app on virtual machine's app server.

我在这里看不到真正的优势(两台机器上仍有环境片段)。
您对此有什么经验并可以与我分享吗?

I can see no real advantage here (still having pieces of environment on both machines). Do you have any experience with that and can share with me?

推荐答案

Vagrant基本上是一个设置工具VirtualBox虚拟机。它为表提供了快速配置VM的能力以及将配置配方传递给其他人的能力。

Vagrant is basically a tool for setting up a VirtualBox virtual machine. It brings to the table the ability to quickly provision a VM and the ability to pass the provisioning recipe to others.

这在Ruby / JS社区非常有用,因为它们没有编译步骤。我们使用它的方式是代码保留在我的本地机器上,所有运行时都在VM上完成。如果我在本地计算机上进行更改,则VM上正在运行的程序会立即获取更改,并且运行时将被修改,就像代码仅在VM上一样。我甚至不需要在我的计算机上安装Ruby / JS。

This is really useful in the Ruby/JS community because they don't have a compile step. The way we use it is the code stays on my local machine and all the runtime is done on the VM. If I make a change on my local computer the running program on the VM instantly picks up the change and the runtime is modified just as if the code was only on the VM. I literally don't even have to have Ruby/JS installed on my computer.

在Java / .Net世界中,你有一个编译步骤,所以你说你需要Java和您需要在计算机上编译的所有jar。这减少了设置的一些有用性。

In the Java/.Net world you have a compile step so as you say you need Java and all the jars you need to compile against on your machine. This lessens some of the usefulness of the setup.

另一方面,您通常拥有与您合作的数据库,消息队列,容器等以及团队拍摄电子邮件并将数据库更新到此版本并加载新的示例数据可能会很痛苦。在Vagrant中,只有一个人需要进行更新,然后他们可以告诉您抓住新的VM,而不必自己进行任何升级步骤。

On the other hand you usually have databases, message queues, containers, etc. that you are working with and on a team it may be a pain to shoot an email and say update your db to this version and load the new sample data. In Vagrant only one person needs to make the updates and they can then tell you to grab the new VM and you do not have to do any of the upgrade steps yourself.

因此它在编译语言中仍然有用,但它没有脚本语言那么有用。

So it is still useful in a compiled language but it is less useful than in a scripting language.

这篇关于vagrant对java / javaee开发人员有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆