EAR 文件和“WebSphere 增强型 EAR”之间有什么区别?
假设我有一个标准 EAR 文件(以及用于生成它的源文件),需要执行哪些额外处理才能将其转换为 IBM WebSphere“增强型 EAR”?
提出此问题的另一种方式是问“增强型 EAR 和标准 EAR 之间有什么区别?”
我非常清楚 Rational 开发工具(RAD 和 RSA)中有工具。但是,出于这个问题的目的,我需要在自动构建中完成相同的任务(通过 Ant 或 Maven)。
Supposing that I have a standard EAR file (and the source files that were used to generated it,) what additional processing needs to be done to convert it to an IBM WebSphere "Enhanced EAR"?
Another way to ask this question would be to ask, "What is the difference between an Enhanced EAR and a standard EAR?"
I'm very aware that there is tooling in the Rational development tools (RAD and RSA.) But, for the purpose of this question, I need to accomplish the same task in an automated build (via either Ant or Maven.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
增强型 EAR 是在 META-INF 目录中添加了一些 XML 文件的 EAR,用于在应用程序、服务器或单元级别配置特定资源(请参阅 IBM 红皮书 WebSphere Application Server V7:打包应用程序以进行部署 了解更多详细信息)。
J2EE 打包、增强型 EAR 和应用程序服务器工具包的表 23-1 (pdf) 列出了这些文件:
替代文本 http://img46.imageshack.us/img46 /6751/table231.png
这些文件位于 META-INF 目录下,将它们嵌入到 Ant 或 Maven 的标准 EAR 中应该非常简单,只需在打包之前将它们放入 META-INF 中即可。
如果您必须从头开始生成这些文件(恕我直言,这没有意义),那么这实际上是另一个故事,我不确定这些文件的结构是否公开可用。
说真的,如果您想使用该功能,请找到一种从 WebSphere 增强型 EAR 编辑器生成文件的方法。也许获得 RAD 的试用版来评估此功能>:) 或者联系 IBM,我相信他们会很乐意
帮助向您出售一些东西,甚至是单个许可证。更新: IBM 提供 Ant Tasks for WebSphere,您也可以使用 antrun 插件从 Maven 使用(这似乎是首选方式)但我不认为
wsDefaultBindings
正是您正在寻找的内容,默认 IBM WebSphere Bindings 不提供与增强型 EAR 具有相同的功能 - 但它们可能很有用并且足够了。以防万一,如果您决定使用wsadmin
任务而不是增强型 EAR,这里是一个An enhanced EAR is an EAR with some XML files added to the META-INF directory to configure specific resources at the application, server or cell level (see the IBM Redbook WebSphere Application Server V7: Packaging Applications for Deployment for more details on this).
Table 23-1 of J2EE Packaging, Enhanced EARs, and the Application Server Toolkit (pdf) lists these files:
alt text http://img46.imageshack.us/img46/6751/table231.png
The files being located under the META-INF directory, embedding them in a standard EAR from Ant or Maven should be pretty straight forward, just put them in the META-INF before packaging.
If you have to generate these files from scratch (this wouldn't make sense IMHO), then it's really another story and I'm not sure that the structure of these files is publicly available.
Seriously, if you want to use that feature, find a way to generate the files from the WebSphere Enhanced EAR editor. Maybe get a trial version of RAD to evaluate this feature >:) Or contact IBM, I'm sure they will be happy to
helpsell you something, even a single license.UPDATE: IBM provides Ant Tasks for WebSphere that you could also use from Maven using the antrun plugin (this seems to be the preferred way) but I don't think that
wsDefaultBindings
is exactly what you're looking for, default IBM WebSphere Bindings don't offer the same features than Enhanced EAR - but they might be useful and enough though. Just in case, if you ever decide to use thewsadmin
task instead of Enhanced EAR, here is a list of options.来自他们的文档:
听起来他们将通常通过管理控制台添加的内容(例如,用于数据源和消息传递的 JNDI、用于安全性的 JAAS)嵌入到 EAR 本身中,以提高服务器之间的可移植性。
From their docs:
Sounds like they embed the stuff that's usually added via the admin console (e.g., JNDI for data sources and messaging, JAAS for security) into the EAR itself for greater portabililty between servers.
您可以使用
wsDefaultBindings
Ant 任务向 EAR 填充所需的部署信息。示例脚本此处。You can populate the EAR with the required deployment information using the
wsDefaultBindings
Ant task. Sample scripts here.