Eclipse:有多个动态Web项目有助于单个战争文件? [英] Eclipse: Have multiple Dynamic web projects contribute to a single war file?

查看:78
本文介绍了Eclipse:有多个动态Web项目有助于单个战争文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我处于一种情况,我基本上希望能够在Eclipse中安装一个Web项目,其中WebContents文件夹从多个项目而不是单个动态Web项目合并。



如果我在项目A中有a.jsp,而在项目B中有b.jsp,那么我想在Web容器中最终得到一个Web应用程序,其中a.jsp和 b.jsp在同一个文件夹中彼此相邻。如果所有文件(而不仅仅是jsp文件)都可以合并,这将是完美的。



这是能够拥有我们应用程序的核心版本,可以轻松处理客户特定的更改。



我知道我可以用合适的ant魔术来做到这一点,但是我们希望对我们目前的基于Eclipse的开发有一些有用的东西处理。我们将在Java类中使用JSR-330依赖注入,本质上我想要依赖注入的方式,但只适用于任何资源,而不仅仅是类。



Eclipse可以这样吗?



如果Eclipse不能,EAR部署是否适合?我目前只有WAR的经验。

解决方案

如果使用Maven是一个选项,那么Maven 覆盖在这里是完美的,理论上应该由m2eclipse插件支持。但是我没有任何经验,可能会有一些问题(请参阅 MNGECLIPSE-599 ),所以这需要一些测试。



然而, MNGECLIPSE- 599 非常有趣,特别是这个:


对这个问题有任何的爱吗?由于这个原因,我们整个团队已经转移到Netbeans进行WAR开发。我们基本上等待Servlet 3.0为我们解决这个问题(Servlet 3.0将有效地否定我们在Maven中做重叠的需要)我们公司很大程度上减少了复制粘贴,所以我们使用覆盖来管理WAR媒体,这些媒体在我们的应用程序。


Java EE 6将覆盖旧的方式对我而言(通过Web Fragments?)不是很清楚,但事实是那个 Eclipse的Java EE 6支持的WTP版本已被推迟到2010年6月 。所以,直到那时,你需要额外的工具(例如maven覆盖),或者应该考虑切换到NetBeans。


I am in a situation where I basically want to be able to have a web project in Eclipse where the WebContents folder is merged from multiple projects instead of only a single dynamic web project.

If I have "a.jsp" in project A, and "b.jsp" in project B, I would like to end up with a single web application in the web container where "a.jsp" and "b.jsp" sit next to each other in the same folder. It would be perfect if all files, not just the jsp-files, could be merged like this.

This is to be able to have a core version of our application but being able to handle customer specific changes easily.

I know I can do this with suitable ant magic, but we want to have something that works well for our current Eclipse based development process. We will use JSR-330 dependency injection on Java classes, and essentially I'd like something along the lines of dependency injection but just for any resource and not just classes.

Can Eclipse do this?

If Eclipse cannot, would an EAR deployment be suitable perhaps? I currently have experience with WAR's only.

解决方案

If using Maven is an option, then Maven overlays would be perfect here and it should theoretically be supported by the m2eclipse plugin. But I don't have any experience with that and there might be some issues (see MNGECLIPSE-599) so this would require some testing.

Nevertheless, the comments of MNGECLIPSE-599 are pretty interesting, especially this one:

Any love for this issue? Our entire team has moved to Netbeans for WAR development because of this. We are basically waiting for Servlet 3.0 to solve this issue for us (Servlet 3.0 would effectively negate our need to do overlays in Maven) Our company is big on reducing copy-paste so we use overlays to manage WAR media that must be common in our apps.

The way Java EE 6 would make overlays obsolete is not crystal clear for me (through Web Fragments?) but the fact is that Eclipse's WTP release with Java EE 6 support has been delayed to June 2010. So, until then, you'll need extra tooling (e.g. maven overlays) or should maybe consider switching to NetBeans.

这篇关于Eclipse:有多个动态Web项目有助于单个战争文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆