在 Eclipse 中显示 Maven War Overlay 文件
我正在尝试制作一个简单的基础战争,其中包括春季的所有样板设置等,以覆盖新项目以避免重写。覆盖本身正在工作,但是,有没有办法显示在 Eclipse 中覆盖的文件以便编辑它们而不替换文件以覆盖它?
谢谢!
I'm trying to make a simple base war which includes all the boilerplate setup for spring, etc. to overlay on new projects to avoid rewriting. The overlay itself is working, however, is there a way to display the files that are being overlayed in eclipse in order to edit them without replacing the file in order to overwrite it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我很难确定你到底在问什么。但我会猜测一下!
我假设 WAR 覆盖 Maven 模块有一个 WAR 类型的工件打包。如果是这样,则可以将此 Maven 模块作为其自己的项目导入到 Eclipse 中(
File->Import->Maven->Existing Maven Projects
)。我们的团队就是这样做的。我们的 Maven WAR 覆盖项目作为一个项目导入到 Eclipse 中,同时几个(下游)Maven WAR 项目也导入到 Eclipse 中。无论 WAR 覆盖和 WAR Maven 模块是多模块 Maven 项目的一部分还是单独的 Maven 项目,都可以完成此操作。
将 Maven WAR 覆盖项目导入 Eclipse 后,您可以像任何其他 Eclipse 项目一样处理它,编辑文件、验证等。完成编辑后,您可以保存工作,然后从命令行运行 Maven,一切都会正常。工作正常。您可以在 Eclipse 中编辑覆盖文件,并且仍然拥有所有 Maven 优点。
请注意,您的 Maven WAR 项目可以作为普通 Java 项目或 WTP(Web 工具平台)项目导入到 Eclipse 中。这完全是一个偏好问题。在过去的一年里,我在 Eclipse 中将 Maven WAR 项目作为常规(未公开的)Java 项目进行工作。然而,最近有了令人惊叹的 M2E-WTP 集成,我现在获得了 WTP 项目的全部好处和 Maven 的强大功能。除此之外,这意味着我可以直接从 Eclipse 内部在 Tomcat 上运行组合的 WAR。如果您想了解如何将 Eclipse/M2E 与 M2E-WTP 结合使用来正确处理 WAR 覆盖,请参阅我的其他答案:
如何在 Eclipse 中处理 Maven WAR 覆盖?
如果您还有其他问题请留言他们在评论部分。
It's a bit difficult for me to ascertain exactly what you are asking. But I'll take a guess!
I assume the WAR overlay Maven module you has an artifact packaging of type WAR. If so, this Maven module can be imported into Eclipse as its own project (
File->Import->Maven->Existing Maven Projects
).Our team does this. Our Maven WAR overlay project is imported into Eclipse as a project along with several (downstream) Maven WAR projects also imported into Eclipse. This can be done regardless of whether the WAR overlay and the WAR Maven modules are part of a multi-module Maven project or are separate Maven projects.
Once the Maven WAR overlay project is imported into Eclipse you can work on it like any other Eclipse project, editing the files, validating, etc. When you are done editing you can save your work and then run Maven from the command line and everything will work fine. You get to edit the overlay files in Eclipse and still have all your Maven goodness.
Note that your Maven WAR projects can be imported into Eclipse as a vanilla Java projects or as WTP (web tools platform) projects. This is totally a matter of preference. For the past year, I worked in Eclipse on Maven WAR projects as regular (unfacted) Java projects. However, recently with the awesome M2E-WTP integration, I now get the full benefit of WTP projects AND the power of Maven. Amoung other things, means I can run the combined WAR on Tomcat from directly inside Eclipse. If you want to understand how to use Eclipse/M2E with M2E-WTP to properly handle WAR overlays, then see my other answer here:
How to handle Maven WAR overlays in Eclipse?
If you have further questions post them in the comments section.