在单台 PC 上构建 J2EE 开发/测试设置

发布于 2024-09-03 01:46:12 字数 700 浏览 2 评论 0原文

自从我从事 Java 工作以来已经有一段时间了,即便如此,我也从未负责从一开始就启动一个大型项目...已经有测试/登台/生产系统正在运行,等等。

现在我希望开始在我值得信赖的工作站上从头开始一个 J2EE 项目,该工作站从未用于 Java 开发并运行 Windows 7 64 位。

首先,我将获得 Eclipse。就编写代码而言,我很高兴。通过 Eclipse 运行它是可以的,但我真正想要的是有一个运行 MySQL 和 TomCat 的 VM,我可以在上面正确部署我的项目并从我的开发 PC“远程”运行/调试它。我想这应该使用 Ant 来完成,而不是让 Eclipse 为我构建 WAR,这样我就不会最终依赖 Eclipse。我确信 Eclipse 可以做到这一点,所以你点击一个按钮,它就会运行 Ant 脚本,例如部署和调试,但对此非常模糊。

这方面有什么好的指南吗?我不想学习 Java,甚至 Ant,而是学习“粘合”部分,例如在 Windows 下启动并运行我的测试 VM、通过 Eclipse 运行构建/测试/部署/运行管道等。 一点,我只打算使用 Windows...在我的 Windwos 桌面上托管 Windows VM。虽然我可以使用像 ant/svn 这样的命令行工具,但我更像是一个喜欢 IDE 集成的 GUI 人...我希望这不会最终成为关于 Linux 或 Vi 等的争论!

我正在寻找免费的,但我是 MAPS 订阅者,并且运行 Win7 Ultimate,以防对免费 VM 解决方案产生影响。

It's been a while since I did Java work, and even then I was never responsible for starting a large project from the very start... there were test/staging/production systems already running, etc, etc.

Now I am looking to start a J2EE project from scratch on my trusty workstation, which has never been used for Java development and runs Windows 7 64bit.

First of all, I'll be getting Eclipse. As far as writing the code goes I'm pretty happy. And running it through Eclipse is OK, but what I'd really want is to have a VM running MySQL and TomCat on which I can properly deploy my project and run/debug it 'remotely' from my dev PC. And I guess this should be done using Ant instead of letting Eclipse build the WAR for me, so that I don't end up with a dependence on Eclipse. I'm certain Eclipse can do this, so you hit a button and it runs Ant scripts, deploys and debugs for instance, but very hazy on it.

Are there any good guides on this? I don't want to be taught Java, or even Ant, but rather the 'glue' parts like getting my test VM up and running under Windows, getting a build/test/deploy/run pipeline running through Eclipse, etc. One point, I only plan to use Windows... hosting a Windows VM on my Windwos desktop. And while I can use command-line tools like ant/svn, I'm much more a GUI person who loves IDE integration... I'd rather this didn't end up an argument about Linux or Vi, etc!

I am looking for free, but am a MAPS subscriber, and run Win7 Ultimate in case that makes a difference as far as free VM solutions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

灵芸 2024-09-10 01:46:12

我不确定是否使用单独的虚拟机进行部署,但我在我的开发计算机上运行本地 SQL 服务器和 tomcat 实例。从 eclipse 部署到 tomcat 对我来说有两个步骤:

  • 运行一个 ant 脚本来构建
    war 到构建目录。
  • 从 eclipse 启动 tomcat

为了完成第二部分,您可以使用 此处 的 Eclipse Tomcat 插件这将为您提供 Eclipse 中用于启动和停止 tomcat 的漂亮工具栏按钮。我配置 tomcat,以便它直接从我的构建文件夹加载应用程序,这样就不会涉及战争文件的复制和分解。

这样做的一个很大的优点是我可以在运行时从 eclipse 调试代码。

如果您对此有任何更具体的问题,请询问。

I'm not sure about using a separate VM for the deployment, but I run a local SQL server and tomcat instance on my dev machine. To deploy to tomcat from eclipse is two steps for me:

  • Run an ant script that builds the contents of the
    war to a build directory.
  • Start tomcat from eclipse

In order to do the second part you can use the Eclipse Tomcat plugin from here This will give you nice toolbar buttons in eclipse for starting and stoping tomcat. I configure tomcat so that it loads the app directly from my build folder so there's no copying and exploding of war files involved.

A great advantage of this is that I can debug the code from eclipse at runtime.

If you've any more specific questions about this just ask.

哑剧 2024-09-10 01:46:12

我使用 NetBeans,它与 glassfish 集成得相当好。不知道Tomcat,但GF有“热部署”功能。基本上,您定义一个应用程序所在的文件夹,您所要做的就是将 war/ear 文件复制到那里并自动部署。 NetBeans 自动执行此操作,并且我还具有集成调试功能。

我相信在 Eclipse 中事情也应该很容易。据我记得,您需要定义一个服务器 - 就像一个单独的项目(配置路径和内容),它会自行完成其余的工作。

哦,我也不认为需要虚拟机。如果它适用于本地主机,那么它也适用于任何主机:)

I use NetBeans which integrates rather nicely with glassfish. Don't know about Tomcat but GF has a "hot deployment" feature. Basically you define a folder where your application is and all you have to do is copy the war/ear file there and is automatically deployed. NetBeans does this automatically and I also have integrated debugging.

I believe in Eclipse things should be easy too. From what I remember you need to define a server - like a separate project (configure the path & stuff) and it does the rest by itself.

Oh, and I also don't see the need for a VM. If it works for localhost it will work for anyhost :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文