在 Mac 上设置 IntelliJ 和 GlassFish
我正在寻求帮助,以制定使用 IntelliJ 和 GlassFish 在 Mac 上启动并运行基本“hello world”Web 应用程序所需的步骤。到目前为止,我已经找到本指南,这很有帮助,但已经过时了(一些对话框/步骤自编写以来已经发生了变化)。
精通这些工具的任何人都可以帮助我整理使用 IntelliJ 9.0.4 将基本 Web 应用程序部署到 GlassFish 3.0.1 所需的步骤吗?
I'm looking for help coming up with the steps required to get a basic "hello world" web app up and running on a Mac using IntelliJ and GlassFish. So far I've found this guide, which is helpful but outdated (some dialogs/steps have changed since it was written).
Can anyone well-versed in these tools help me sort out the steps required to get a basic web app deployed to GlassFish 3.0.1 using IntelliJ 9.0.4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
首先,让 Glassfish 独立运行。这种体验会对您很有帮助,因为该过程在所有 Unix 系统上几乎都是相同的。如果您只学习通过 IDE 与 Glassfish 交互,那么如果没有 IDE,您将完全迷失方向。
部署应用程序有两种方法:通过管理 Web 界面(用户友好,但速度慢得令人痛苦),或通过命令行。执行后者的方法如下:首先,确保 Glassfish 附带的
asadmin
实用程序在您的路径上,然后执行如下操作:默认情况下,admin 用户的密码为空;如果没有,系统会提示您输入。
First, get Glassfish running on its own. This experience will serve you well, since the process is pretty much the same on all Unix systems. If you only learn to interact with Glassfish through your IDE, then you'll be totally lost without the IDE.
There are two ways to deploy an app: through the admin web interface (user-friendly, but painfully slow), or through the command line. Here's how you do the latter: first, make sure that the
asadmin
utility that came with Glassfish is on your path, then do something like this:By default, the admin user has an empty password; if it doesn't, you'll be prompted for it.
我不了解 Glassfish,但我可以告诉你如何使用 Tomcat 做到这一点。唯一的区别应该是您在 IntelliJ 中启动的应用程序服务器:
JNDI 设置中有一个 index.html 欢迎文件是另一回事。
I don't know about Glassfish, but I can tell you how to do it with Tomcat. The only difference should be the app server that you start inside IntelliJ:
JNDI set up is another matter.
IMO 在任何应用程序服务器上部署 EAR/WAR 的最佳方法是使用 Maven 构建 EAR 和 Cargo Maven 插件以进行重新部署。我使用它的原因是它完全独立于 IDE,并且可以在开发和我的持续集成服务器中使用它。
Glassfish 的 EAR/WAR 模块的 pom.xml 片段:
重新部署命令:
如果您不知道 Maven 2 是什么,您应该了解它。
IMO the best way to have an EAR/WAR deployed on any application server is to use Maven to build an EAR and Cargo Maven plugin for redeploying. The reason why I would use it is that it's totally IDE-independent and can use it both in development and my continuous integration server.
pom.xml fragment of EAR/WAR module for Glassfish:
Redeploy command:
You should learn about Maven 2 if you don't know what it is.
我成功完成了本教程:在 IntelliJ IDEA 10 中开发 GlassFish Server 应用程序。我正在使用 IDEA 11 和 GlassFish 3.1.2
I had success with this tutorial: Developing applications for GlassFish Server in IntelliJ IDEA 10. I'm using IDEA 11 and GlassFish 3.1.2