如何在不使用管理控制台的情况下在 websphere 8 上部署 war?
我们如何在不使用 websphere 管理控制台的情况下在 websphere server 8 上部署一个简单的 war 文件?
作为手动部署的一部分,我需要知道
- 将 war 文件手动放置在服务器上的哪里?
- war 使用 jndi 进行数据库连接,因为我们不想使用管理控制台, 我们如何创建jndi数据源?
- 我们还想外部化属性文件。 (就像我以前保留的 jboss 中的 JBOSS_HOME/server/default/conf 文件夹中的 application.properties 而不是 app.war/web-inf/classes )
请帮忙
PS:实际上我们将有一个 ant 构建,它将为我们做这三件事,以便我们不必转到管理控制台。只需运行 ant build,它就会复制 war,创建 jndi 等内容。
How do we a deploy a simple war file on the websphere server 8 without using the websphere administration console?
As a part of the manual deployment I will need to know,
- where to put the war file manually on the server?
- war uses jndi for db connection, since we do not want to use admin console,
how do we create jndi data sources? - we would also want to externalize the properties file. (like I used to keep
application.properties in JBOSS_HOME/server/default/conf folder in jboss instead of the app.war/web-inf/classes)
Please help
PS: Actually we will be having an ant build which will do these three things for us so that we don't have to go to the admin console. Just run the ant build and it will copy war, create jndi etc stuff.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
完成您想要的操作的最佳方法是编写 wsadmin 脚本。
使用 wsadmin,您可以在 WebSphere 中部署、添加/删除/修改资源,几乎可以执行任何操作。
我建议你阅读wsadmin 脚本编写入门
The best way of doing what you want is writing a wsadmin script.
Using wsadmin you can deploy, add/delete/modify resources in WebSphere, pretty much anything.
I would suggest you read Getting started with wsadmin scripting
您还可以使用服务器配置文件下的“monitoredDeployableApps”文件夹。您可以从管理控制台启用此功能 ->应用->全局部署设置。
You can also use 'monitoredDeployableApps' folder under server profile. You can enable this feature from the admin console -> Applications -> Global deployment settings.
简单且最佳的方法是通过两个步骤实现此目的:(v 8+)
在管理控制台中启用“monitoredDeployableApps”功能 ->应用->全局部署设置并重新启动服务器。 (重新启动后,您将在配置文件中看到一个文件夹“monitoredDeployableApps”(默认名称,启用此功能时可以更改)
将您的 war 文件拖放到其中此文件夹(无需重新启动)和服务器的观察器 Systemout.log 在管理控制台中验证已部署的应用程序。
注意:确保您的上下文根已填充到您的可部署(war、ear、...)文件中
。
Simple and best way to do this is in two steps: (v 8+)
Enable 'monitoredDeployableApps' feature in Admin Console -> Applications -> Global Deployment Settings and restart the server. (once restart you will see a folder in your profile 'monitoredDeployableApps' (default name and can be changed while enabling this feature)
Drag and Drop your war file in this folder (no restart needed) and observer Systemout.log of the server. Verify in Admin Console for the deployed application.
NOTE: Make sure your context-root is populating to your deployable (war,ear,...) files.
-- Prakash Karri