具有多个 WAR 和共享依赖项(包括公共数据源文件)的 JBoss EAR
我们将从单个 WAR 转变为多个 WAR,以便在 JBoss 中重新打包到一个 EAR 文件中。我希望能够执行以下操作:
- 将公共库移至新 EAR 的根目录下,以便不必在每个 WAR 中重复它们(我想在 $EAR_ROOT/lib 下?)。
- 将 *-ds.xml 文件从 $JBOSS_HOME/server//deploy 下移动到 EAR 下,以便数据源的范围限定为应用程序(至少从打包的角度来看 - 我意识到无法阻止从其他 WAR 进行 JNDI 查找) ,没关系)。
- 将 Hibernate DAO 和依赖项重新打包到一个新的要共享的 JAR 文件中,并将它们也放在公共位置(由两个 WAR 共享)。
我对需要发生的事情有一定的了解,但可以使用一些帮助,这样我就不必从头开始创建所有这些结构和相关的 Ant/Maven 目标/目标。例如,数据源文件应该在 jboss-app.xml 中引用还是直接在 application.xml 中引用?
似乎有多种方法可以给这只猫剥皮,我正在寻找一个漂亮、干净的例子来做到这一点(为了不必重新发明轮子)。
We are going from a single WAR to multiple WARs to be repackaged within an EAR file in JBoss. I would like to be able to do the following:
- Move common libraries to under the root of the new EAR so that they don't have to be duplicated within each of the WARs (I suppose under $EAR_ROOT/lib?).
- Move the *-ds.xml file from under $JBOSS_HOME/server//deploy to under the EAR so that the datasource is scoped to the application (at least from a packaging standpoint - I realize there is no preventing a JNDI lookup from other WAR, that's okay).
- Repackage the Hibernate DAOs and dependencies to a new to-be-shared JAR file and put them in the common location as well (to be shared by both the WARs).
I have some sense on what needs to happen but could use some help so that I don't have to create all of this structure and the related Ant/Maven targets/goals from scratch. For instance, should the datasource file be referenced in jboss-app.xml or in application.xml directly?
There seem to be multiple ways of skinning this cat and I am looking for a nice, clean example to do this (in the interest of not having to reinvent the wheel).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 JBoss Developer Studio,它可以为您完成这一切
Use JBoss Developer Studio, it does all that for you