Reputation: 4970
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!
Upvotes: 3
Views: 1236
Reputation: 21924
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.
Upvotes: 3