Eclipse Output Folders

后端 未结 6 444
滥情空心
滥情空心 2020-12-21 07:38

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

相关标签:
6条回答
  • 2020-12-21 08:00

    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.

    0 讨论(0)
  • 2020-12-21 08:04

    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.

    0 讨论(0)
  • 2020-12-21 08:06

    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.

    1. Create a new "Dynamic Web Project" and complete the first step of the wizard based off you project preferences.
    2. Select Next > Next to get you to the "Web Module" configuration settings.
    3. Enter your context root and change your "Content Directory" to "war" and click "Finish"

    This will create you just a basic web project you will next need to enable GWT on this project and add you base configurations.

    1. Open your project Properties and goto "Google" > "Web Toolkit" and check "Use Google Web Toolkit" Select "Ok" to close this dialog box.
    2. Select "File" > "New" > "Other" to open the new "New" dialog box. Select "Google Web Toolkit" folder then select "Module" then "Next"
    3. Enter your package info and module name. This will create you your ModuleName.gwt.xml file in the package you entered. It will also create a empty your.package.name.client for you.
    4. Select "File" > "New" > "Other" again and this time select "Entry Point Class." In the wizard that opens confirm that Module, Package, and Source are correct. Enter the "Name" of the Entry point, This would typically be your module name. Then select "Finish"
    5. One more time select "File" > "New" > "Other" and select "HTML Page." Confirm that "Path" is pointing to "war" and "Modules" displays your module. Enter the "FileName" this can be anything you want i.e. index.html, index.jsp, module.html

    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.

    0 讨论(0)
  • 2020-12-21 08:11

    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.

    0 讨论(0)
  • 2020-12-21 08:12
    1. You mail project is Java project. To build war you need Dynamic Web Project

    2. In Web project that you will create, set mail/war as a content directory (instead of default WebContent).

    3. Refactor->Move mail/www directory to mail/war/www

    4. When you export WAR, make sure you include source code.

    Now if you export WAR, it will contain what you asked for.

    0 讨论(0)
  • 2020-12-21 08:15

    If you wanna use GWT on eclipse, you should use the Google Plugin for Eclipse

    0 讨论(0)
提交回复
热议问题