使用 EAR 库配置 Helios WTP 实用程序项目的构建路径
我创建了三个项目:一个 EAR 父项目、一个 EJB 子项目和一个 Utility 子项目。我将一个 jar 和实用程序项目添加到“Ear Module Assembly”中。在这两个子项目中,我将 jar 放在 MANIFEST.MF 类路径中,并且这两个项目的构建路径上都有 EAR 库。从 eclipse 中,jar 中的所有类都可以从 EJB 项目中找到,但不能从 Utility 项目中找到。为了在实用程序项目构建路径上获取 jar,我必须将其与 Ear 库分开添加。
如果您从“配置构建路径”窗口查看 EAR 库的属性,它会显示“EAR 库类路径容器使用 META-INF/MANIFEST.MF 类路径条目动态计算 Java EE 项目的模块类路径依赖项”。
为什么这仅适用于 EJB 项目构建路径而不适用于实用程序项目?如果实用程序项目不能将 EAR 库用于构建路径,而只能用于运行时类路径,那么为什么默认情况下它甚至包含在构建路径中?
I create three projects: An EAR parent project, an EJB child project, and a Utility child Project. I add a jar and the utility project to the "Ear Module Assembly". In both child projects I put the jar in the MANIFEST.MF classpath, and both projects have EAR Libraries on their build path. From eclipse all of the classes in the jar can be found from the EJB project, but not from the Utility project. In order to get the jar on the utility projects build path I have to add it seperate from the Ear Libraries.
If you look at the properties of EAR Libraries from the "configure build path" window, it says "The EAR Libraries classpath container dynamically computes the Java EE project's module classpath dependencies using the META-INF/MANIFEST.MF Class-Path entries."
Why does this only work for the EJB projects build-path but not the utility project? If utility projects cannot use EAR libraries for the build-path but only for the runtime class-path then why was it even included on the build-path by default?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
切换到 Indigo 时,实用程序项目的构建路径似乎表现符合预期。将 jar 添加到 MANIFEST.MF 后,它就会显示在 EAR 库下的构建路径中。
The utility project's build-path seems to be behaving as expected when switching to Indigo. Once you add the jar to MANIFEST.MF it shows up on the build-path under EAR Libraries.