With following structure, how can I make Eclipse build the WAR file correctly?
I need following folders to go into following output folders:
mail/src
Your www folder shouldn't be a source folder (with the small package icon). It should be a regular folder and reside at mail/war/www.
As for mail/src, just have a look at the build path of the project and make sure that the output folder is set to mail/war/WEB-INF/classes.
Right, so the solution was to move WEB-INF into /www/ and make a WEB-INF/classes/ folder containing a dummy file.
Without the dummy file Eclipse wouldn't build, and complain about the classes folder didn't exist.
I don't typically create my GWT projects using the "Web Application Project" wizard as I don't like having to remove all default servlets and classes. I usually create them as "Dynamic Web Projects" which will allow you to export as a WAR among other things.
This will create you just a basic web project you will next need to enable GWT on this project and add you base configurations.
At this point you have a Dynamic Web Project that is fully GWT enabled. To get the run setting set up properly just select "Run" from the menu and select "Run" again. Then select "Web Application" from the dialog box.
I suggest a small ant build script. Ant is already integrated in eclipse, just drop a build.xml file in the root directory and either build manually or add an Ant builder to the project.
You mail project is Java project. To build war you need Dynamic Web Project
In Web project that you will create, set mail/war as a content directory
(instead of default WebContent
).
Refactor->Move mail/www
directory to mail/war/www
When you export WAR, make sure you include source code.
Now if you export WAR
, it will contain what you asked for.
If you wanna use GWT on eclipse, you should use the Google Plugin for Eclipse